【发布时间】:2014-10-03 13:50:15
【问题描述】:
我在我的角度模块中有一个自定义指令,我想动态插入到我的视图中,其中包含来自模块中控制器内部函数的不同信息的多个实例。这是如何完成的?例如,here is a sample fiddle 用来向我展示这是如何完成的
var myApp = angular.module('myApp',[]);
myApp.directive('myDirective', function() {
return {
restrict: "E",
transclude: true,
template: "<div><h4>Hello, World!</h4></div>"
}
});
function MyCtrl($scope) {
$scope.insertDir = function(){
//????
}
}
【问题讨论】:
标签: javascript asp.net angularjs