i have problems , after have put ui-route modal , page , have probleme ui-route works first time , don't know why
this route
angular.module('ui.bootstrap.demo').config(function($stateprovider, $urlrouterprovider,$qprovider){ $stateprovider .state("connexion", { url: "/", views: { // column two, we'll define separate controller 'principal': { abstract :true, templateurl: 'connexion.html' } } }) .state('agenda', { url: "/agenda", views: { // column two, we'll define separate controller 'principal': { abstract :true, // templateurl: 'agenda.html' template:'<a ui-sref="view">open me!</a>' } } }) .state('modal', { abstract: true, parent: 'agenda', url: '/modal', onenter: ['$uibmodal', '$state', function($uibmodal, $state) { $uibmodal.open({ animation: true, arialabelledby: 'modal-title', ariadescribedby: 'modal-body', templateurl: 'mymodalcontent.html', controller: 'modalinstancectrl', resolve: { } }) }] }) .state('view', { url: ':id1', parent: 'modal', views: { 'modal@': { template: '<div class="navbar">'+ '<div class="navbar-inner">'+ '<h4 class="brand">quick start</h4>'+ '<ul class="nav">'+ '<li><a ui-sref="foo">route 1</a></li>'+ '<li><a ui-sref="bar">route 2</a></li>'+ '</ul>'+ '</div>'+ '</div>' } } }) .state('foo', { url: ':id2', parent: 'modal', views: { 'modal@': { template: '<h1>foo</h1><a ui-sref="view">back menu</a>' } } }) .state('bar', { url: ':id3', parent: 'modal', views: { 'modal@': { template: '<h1>bar</h1><a ui-sref="view">back menu</a>' } } }) $urlrouterprovider.otherwise("/"); $qprovider.erroronunhandledrejections(false); })
and plunker,
http://plnkr.co/edit/4d6fsqv0fipqtjoniebs?p=preview
if 1 can me
thanks in advance
edit
hello guys
re edit
.state('modal', { abstract: true, parent: 'agenda', url: '/modal', onenter: ['$uibmodal', '$state', function($uibmodal, $state) { $state.go('view'); $uibmodal.open({ animation: true, arialabelledby: 'modal-title', ariadescribedby: 'modal-body', templateurl: 'mymodalcontent.html', controller: 'modalinstancectrl', resolve: { } }) }] })
Comments
Post a Comment