CLI
ng-state has optional package ng-state-cli which makes developers lives easier by generating new files or integrating state management to existing ones.
Install it from npm
npm install ng-state-cli -gIn terminal type ngstate and answer couple questions:
Name of the component - e.g:
todosChoose directory
Enter state path like you do in
@InjectStoredecorator - e.g:['todos', '${stateIndex}']or 'todos'Chose
AddorAppend
When Add is chosen ng-state-cli will generate these files
actions
component
html template
styles
spec

When Append is chosen ng-state-cli will do following
generate action
modify component file
modify spec file
Append plays nice with angular cli

Last updated
Was this helpful?