當前我正在使用非常強烈的形式,並在HTML上使用輸入,textareas,datepickers等,這會使代碼看起來非常難看,也很難閱讀。 的事情是,我創建了返回正確的HTML元素如自定義指令:從自定義指令中調用角度UI引導指令
在HTML
<suggest-input data-ng-model="EDCtrl.headerStep.provider.identification"
placeholder="'Ej. 888888-8'"
label="'Identificador de emisor'">
</suggest-input>
指令:
var suggestInput = function ($compile, $http) {
return {
restrict: 'E',
require: 'ngModel',
templateUrl: templates + '/suggestInputTemplate.tpl.html',
replace: true,
scope: {
model: '=ngModel',
label: '=label',
title: '=title',
placeholder : '=placeholder'
},
};
};
模板
<div>
<label>{{ label }}</label>
<input class="form-control" data-ng-model="model" placeholder="{{ placeholder }}" call="functionName()"/>
</div>
,我在使用角度引導指令時遇到問題我的自定義指令,例如: 如何在我的自定義指令中使用這種配置調用「uib-typeahead」?
任何想法?
[自定義指令中的Angular UI指令]的可能重複(https://stackoverflow.com/questions/48654008/angular-ui-directive-inside-custom-directive) – Isaac