S
S
Sizoider2016-04-15 02:49:59
Angular
Sizoider, 2016-04-15 02:49:59

Why did the slider stop working after adding ng-view?

Hello everyone
, I added angular, and specifically the ng-view directive and the slider stopped working.
that is, the slider is in a separate file.
What dances with a tambourine are needed to make everything work back?
home.html

<article class='col-md-10'>
      <div class="slider">
            <img src="img/slider1.jpg" class="img-responsive" alt="slider pic"/>                  
            <img src="img/slider2.jpg" class="img-responsive" alt="slider pic"/>
            <img src="img/slider3.jpg" class="img-responsive" alt="slider pic"/>
            <img src="img/slider4.jpg" class="img-responsive" alt="slider pic"/>
            <img src="img/slider5.jpg" class="img-responsive" alt="slider pic"/>
            <img src="img/slider6.jpg" class="img-responsive" alt="slider pic"/>
    		</div>
</article>

angular.module('App', ['ngRoute','ngAnimate'])
  .config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider){
    $routeProvider
      .when('/bio', {
        templateUrl : 'bio.html'
      })
      .when('/contact', {
        templateUrl : 'contact.html'
      })
      .when('/home', {
                                 //страница со слайдером
        templateUrl : 'home.html'
      })
      .otherwise({
                             //страница со слайдером
        redirectTo: '/home'
      })
      //$locationProvider.html5Mode(true);
  }])
    .controller('MainCtrl', ['$scope', function($scope) {
   }]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2016-04-15
@AMar4enko

Replace the slider code with a directive from the ui-bootstrap package if you are using it, or wrap the slider code in a directive.
If you are using Angular, go the angular way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question