我有一个问题,指令的等价物是什么:编译(前/后)?
javascript 中的示例:
angular.module('app').directive('checkBox', function () {
return {
//... my directive options
compile: function () {
return function () {
pre: function (scope) {}
post: function (scope) {}
}
}
}
});
什么是 TypeScript?
最佳答案
它将等同于:
public compile = (element: JQuery, attrs: angular.IAttributes, transclude: any): DirectivePrePost => {
return {
pre: ($scope: any, element: JQuery, attrs: angular.IAttributes) => {
},
post: ($scope: any, element: JQuery, attrs: angular.IAttributes) => {
}
};
}
关于angularjs - TypeScript 中指令、编译(前/后)的等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26202456/