使用指令定义对象(我认为它被称为..?)的以下代码(在 Widget Uno 中)之间的功能区别是什么...
angular.module("app").
directive("widgetUno", ["$http", function ($http) {
return {
// A whole bunch of crap going on here
},
templateUrl: "widgetUno.html"
};
}]);
...而 Widget Dos 中的这段代码?
angular.module("app").directive('widgetDos', function($http) {
return function(scope, element, attrs) {
// A whole bunch of crap going on here
};
});
我正在尝试将类似于 Widget Uno 的指令转换为 Widget Dos,但是我在哪里引用 templateUrl?这在 Widget Dos 中可行吗?