如何在angularjs上配置Siema插件

时间:2017-09-27 14:31:12

标签: javascript angularjs siema

我正在尝试实施Siema(https://pawelgrzybek.com/siema/) 但它永远不会奏效。它就像它永远不需要配置并且不会初始化任何东西。 这是angularjs 1.6。 THX。

suggestion.component.js

 (function () {
        'use strict';

        angular
            .module('amSuggestions')
            .component('suggestionsSlider', {
                bindings: {
                    suggestions: '<'
                },
                templateUrl: 'suggestions-slider/suggestions-slider.html',
                controller: SuggestionsSliderController
            });

        function SuggestionsSliderController() {

            this.$onInit = function () {
                var mySiema = new Siema({
                    selector: '.siema',
                    perPage: {
                        768: 2,
                        992: 4
                    }
                });
            };
        }
    })();

suggestion.jade

.siema
    div(ng-repeat="suggestion in $ctrl.suggestions | limitTo: 4")
        suggestion(suggestion="suggestion")

0 个答案:

没有答案