gpt4 book ai didi

angularjs - TypeScript 中指令、编译(前/后)的等价物是什么?

转载 作者:搜寻专家 更新时间:2023-10-30 20:41:33 24 4
gpt4 key购买 nike

我有一个问题,指令的等价物是什么:编译(前/后)?

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com