我正在尝试使用angular 1.5.0-beta.2的应用程序
要制作'指令',我有以下代码:
myApp.component('gridshow', {
bindings: {
slides: '='
},
controller: function() {
},
controllerAs: 'grid',
template: function ($element, $attrs) {
// access to $element and $attrs
return [
'<div class="slidegrid">',
'<div ng-repeat="slide in grid.slides">',
'{{slide.image}}',
'</div>',
'</div>'
].join('')
}
});
Run Code Online (Sandbox Code Playgroud)
我喜欢与访问返回函数模板的想法$element和$attrs,但我怎么结合这与templateUrl?