I couldn't find anything since there's not a lot of documentation on this topic, especially for Angular 2. I have created a non image slider outside angular 2 that works, but when I tried to implement it in my angular 2 project I get "Loading...".
Slider Code:
<div class="cycle-slideshow"
data-cycle-fx="fade"
data-cycle-timeout="10000"
data-cycle-pause-on-hover="false"
data-cycle-slides=">div">
<span class="cycle-prev">〈</span>
<span class="cycle-next">〉</span>
<span class="cycle-pager"></span>
<div class="frontend">
<h2>My experience</h2>
</div>
Html code:
<head>
<base href="/">
<title>Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<!--Bootstrap-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"crossorigin="anonymous">
<!--Font awesome icons-->
<link href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet" type='text/css'>
<!--Font-->
<link href="https://fonts.googleapis.com/css?family=Indie+Flower" rel="stylesheet">
<!--Loading page-->
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<!--script-->
<script type="text/javascript" src="./assets/js/script.js"></script>
<script type="text/javascript" src="./assets/js/jquery-3.2.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="./assets/js/jquery.cycle2.min.js"></script>
</head>
Could it be because of the jquery version?
cycle2 Integration in Angular
The following answer is an example how to integrate a simple cycle2 slider into angular using @angular/[email protected]
cycle2 demo is from cycle2 webpage (I have no experience with cycle2).
cycle2.html
Setup new project with @angular/cli and do the following changes:
app.component.tstitle changedapp.component.htmldiv copied into fileindex.htmlscript tags for cycle addedNow start with
ng servefrom terminal and cycle demo is running in angular.cycle2 Integration done. :-)
A description to use bootstrap with angular is angular-cli and bootstrap 4
Non-Image-slider-Example
cycle2 pure Non image slider example from http://jquery.malsup.com/cycle2/demo/non-image.php
cycle2NonImageSlider.htlm
app.component.htmlfor non-slider-imagescycle2 integration for non-image sliders work :-)