这是我的html:
<a href="#modal{{screencast.id}}" role="button" class=" btn" data-toggle="modal"
ng-click="fetch_comments(screencast.id)" ng-video url="match_url(screencast.video_url)">Play</a>
我的指令:
'use strict';
App.directive('ngVideo', [function () {
return {
restrict: 'A',
scope: { url: '='},
link: function (scope, elem, attrs) {
elem.bind('click', function () {
console.log(scope.url);
});
}
}
}]);
当我刷新页面时,href="#modal{{screencast.id}}"我只有href="#modal". 当我scope: { url: '='}从指令中删除时,它工作正常,并且href具有screencast.id. 我做错了什么?