mercredi 6 mai 2015

Angular only loads first directive

I have declared two directives by the following design pattern:

var sampleDrtv = function () {
    return {
        restrict: 'E',
        replace: true,
        scope: false,
        templateUrl: 'app/views/partials/sample.html',
        link: function() {
            alert('sample');
        }
    }
};

angular
.module('app')
.directive('sampleDrtv', sampleDrtv);

If I add two directives following this pattern, only the first one gets loaded. Can someone explain me why?

Code Snippet: http://ift.tt/1JQz6mJ

Aucun commentaire :

Enregistrer un commentaire