1
我想從控制器調用的服務方法中的下面的代碼打開引導模式。角控制器自舉模式
openModal(type){
this.$modal.open({
animation: this.$rootScope.animationsEnabled,
templateUrl: '../app/components/'+type+'/'+type+'.html',
controller: DynamicController,
controllerAs: 'vm'
});
}
,將模態通過點擊下面的鏈接激活。
<li><a href ng-click="openModal('signup','LoginController')">Sign In</a></li> {{test}}
<li><a href ng-click="openModal('signup','SignupController')">Sign Up</a></li>
我想讓模態根據點擊的鏈接使用相應的控制器(代替DynamicController)。有沒有更好的方法來實現這個功能?
有可能是一個「好」的方式,但我喜歡你做了什麼(除了忘記DynamicController其他參數在openModal上) – jbrown