@ovh-ux/ng-uirouter-layout
v1.2.1
Published
UiRouter Layout support
Downloads
17
Readme
ng-uirouter-layout
Support layout:modal when using ui-router
Install
yarn add @ovh-ux/ng-uirouter-layout
Usage
// index.js
import angular from 'angular';
import ngUiRouterLayout from '@ovh-ux/ng-uirouter-layout';
angular
.module('myApp', [
ngUiRouterLayout,
]);
With controller and template
// routing.js
import controller from './controller';
import template from './template.html';
...
$stateProvider
.state('state.name', {
url,
views: {
modal: {
controller,
template
},
},
layout: 'modal',
});
With component
// routing.js
$stateProvider
.state('state.name', {
url,
views: {
modal: {
component: 'awesomeModal',
},
},
layout: 'modal',
});
With a component provider
// routing.js
$stateProvider
.state('state.name', {
url,
views: {
modal: {
componentProvider:
predicate => predicate
? 'awesomeModalForTruePredicate'
: 'awesomeModalForFalsePredicate',
},
},
layout: 'modal',
});
Contributing
Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.
License
BSD-3-Clause © OVH SAS