angularjs – 在TypeScript中指令,编译(前/后)的等价物是什么?
发布时间:2020-12-17 06:56:24 所属栏目:安全 来源:网络整理
导读:我有一个问题是什么是指令的等价物:编译(前/后)? javascript中的示例: angular.module('app').directive('checkBox',function () { return { //... my directive options compile: function () { return function () { pre: function (scope) {} post: fu
我有一个问题是什么是指令的等价物:编译(前/后)?
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,attrs: angular.IAttributes) => { } }; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |