如何在angularjs中定义指令的参数类型?使用什么类型进行&
绑定?
请参阅示例代码中的 ngdoc 或 jsdoc。
UPD:我的目标是获得以下问题的答案
* @param {<< what to write here? >>} parentContextExpression
* @param {<< what to write here? >>} oneWayParameter
angular.module('app', [])
.directive('exampleDir', exampleDir);
/**
* @ngdoc directive
* @module app
* @name app.directive:exampleDir
* @param {<< what to write here? >>} parentContextExpression
* @param {<< what to write here? >>} oneWayParameter
* @param {Object=} twoWayParameter
* @usage
* <example-dir
* parent-context-expression="externalFn()"
* one-way-parameter="parentScopeVariable"
* two-way-parameter="parentScopeObject"
* ></example-dir>
**/
function exampleDir() {
return {
template: '...',
scope: {
parentContextExpression: '&',
oneWayParameter: '@',
twoWayParameter: '="
}
}
}