Matteo Scandolo | f2c3ed6 | 2016-12-15 14:32:50 -0800 | [diff] [blame] | 1 | import {IXosState} from '../../../index'; |
| 2 | export interface IRuntimeStatesService { |
Matteo Scandolo | e0d71ea | 2016-12-19 11:56:12 -0800 | [diff] [blame] | 3 | addState(name: string, state: ng.ui.IState): void; |
Matteo Scandolo | f2c3ed6 | 2016-12-15 14:32:50 -0800 | [diff] [blame] | 4 | } |
| 5 | |
Matteo Scandolo | e0d71ea | 2016-12-19 11:56:12 -0800 | [diff] [blame] | 6 | export function RuntimeStates($stateProvider: ng.ui.IStateProvider): ng.IServiceProvider { |
| 7 | this.$get = function($state: ng.ui.IStateService) { |
Matteo Scandolo | f2c3ed6 | 2016-12-15 14:32:50 -0800 | [diff] [blame] | 8 | return { |
| 9 | addState: function(name: string, state: IXosState) { |
| 10 | $stateProvider.state(name, state); |
| 11 | } |
| 12 | }; |
| 13 | }; |
| 14 | return this; |
| 15 | } |