3
我有一個指令鏈接功能。默認的角度鏈接函數是一個後鏈接函數,不是嗎?如何將其作爲預先鏈接?將角度指示鏈接功能作爲預鏈接嗎?
app.directive("textBoxCol", function() {
return {
require: "^grid",
restrict: "E",
replace: true,
scope: {
title: "@title",
cssClass: "@class",
dataField: "@field"
},
link: function ($scope, element, attrs, grid) {
$scope.type = ColumnType.TextBox;
tableControl.addColumn($scope);
}
};
});
順便說一句,它使用的要求。