angularjs – UI-Router模式更改现有视图
发布时间:2020-12-17 09:42:16 所属栏目:安全 来源:网络整理
导读:我正在尝试使用ui-router来触发某个状态的模态,而不是改变整个视图.为了做到这一点,我实施了一个稍微改编的 what is given in the FAQ形式,因为我使用 angular-foundation而不是bootstrap.当我触发状态时,显示模态,但是它也会清除现有视图,即使在我的状态下
我正在尝试使用ui-router来触发某个状态的模态,而不是改变整个视图.为了做到这一点,我实施了一个稍微改编的
what is given in the FAQ形式,因为我使用
angular-foundation而不是bootstrap.当我触发状态时,显示模态,但是它也会清除现有视图,即使在我的状态下没有指定任何视图:
.state('selectModal',onEnter: ($modal,$state,$sessionStorage) -> $modal.open( templateUrl: 'views/select_modal.html' windowClass: 'tiny' controller: 'SelectCtrl' resolve: options: (Restangular) -> Restangular.all('options').getList() ) .result.then (result) -> $sessionStorage.selected = result $state.go 'resource',id: result.id ) 我应该为此状态配置视图/父母,例如< div ui-view ='modal'>< / div>或父母:“主”(我希望从任何状态可以访问,而不改变该状态时切换)?
通过使用“.”指定它具有父状态.命名约定(将“parentState”替换为实际父项的名称):.state(‘parentState.selectModal’,…
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |