在使用angular和swiper插件中的一些问题

在使用angular获取swiper图片的时候swiper就不会轮播。

    解决方法:

      1.使用计时器的方法,不是最优

        

settimeOut(function(){
     mySwiper = new Swiper(".swiper-container",{
           autoplay:true,
           //自动播放

    })
    
})    

    2.使用函数 自调

function swiper(){
     mySwiper =  new Swiper(".swiper-container",{




    })

}
swiper()

  3.往angular服务器中服务注入一个方法

var app = angular.module("app",[]);
app.controller = function($scope,$http){
    $http.get("").success(function(){

    })
    $scope.swiper = function(){
     
       mySwiper = new Swiper(".swiper-container",{

         })

    }

}

  

如用更好的方法希望能一起学习。