0
您好,我有一個需要從指令中刪除templateURL,而不得不從服務器使用主頁中的自定義標記庫(Java)加載客戶端DOM。現在是否可以使用指令將其中的函數鏈接到已經加載的DOM?將指令綁定到angularjs中已經加載的DOM元素?
MainPage.jsp
<div class="col-sm-10">
<div class="input-group input-group-sm col-sm-12">
<div class="nopadding" provider provider-name="providerForFilter" topclass="providerForFilter" class="col-sm-10" >
<prefixrj:lookupprovider data="" defaultValue="" filterPosition="" showActive="" ></prefixrj:lookupprovider>
</div>
</div>
</div>
lookup.js
var providerlookup = f.module('providerlookup', []);
providerlookup.directive('provider', function($http, $timeout) {
return {
restrict: 'AE',
replace: 'true',
templateUrl: '/mobiledoc/jsp/webemr/lookup/provider-lookup.jsp',
scope: {
topclass: "@",
providerName: "=providerName",
providerClick: "&",
clearProviderData: "&",
disableproviderlookup: "=",
multiSelection: "@"
},
link: function(scope, element, attributes) {
var isLoading = false;
var timer = "";
scope.editable = true;
scope.multiSelection = scope.multiSelection == undefined ? false : scope.multiSelection;
if (!scope.providerName) {
scope.providerName = {provider: ""};
}
.....................
.....................
}
};
});
現在不是在templateUrl 提供商lookup.jsp,我要加載的內容是使用JSP定製標記庫顯示在MainPage.jsp中。