How to initiate MixItUp with AngularJS NgRoute

前端 未结 4 1024
囚心锁ツ
囚心锁ツ 2021-01-18 07:55

I\'ve been setting up a jquery plugin MixItUp with AngularJS and although I can successfully initiate the container during one of my partial views with NgRoute, once I move

4条回答
  •  庸人自扰
    2021-01-18 08:15

    I'd recommend you to use directives when you are working with DOM. So you need to create some directive that will initiate MixItUp for you

    angular.module('app').directive('myNgMixitup', [function(){
       return {
          restrict: 'AEC',
          link: function(scope, element){
             //now you can access the element/container
             element.mixItUp();
          }
       };
    }])
    

提交回复
热议问题