File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1129,16 +1129,12 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
1129
1129
* @description
1130
1130
* Returns the state configuration object for any specific state or all states.
1131
1131
*
1132
- * @param {string|object = } stateOrName (absolute or relative) If provided, will only get the config for
1132
+ * @param {string|Sbject = } stateOrName (absolute or relative) If provided, will only get the config for
1133
1133
* the requested state. If not provided, returns an array of ALL state configs.
1134
- * @returns {object|array } State configuration object or array of all objects.
1134
+ * @returns {Object|Array } State configuration object or array of all objects.
1135
1135
*/
1136
1136
$state . get = function ( stateOrName , context ) {
1137
- if ( arguments . length === 0 ) {
1138
- var list = [ ] ;
1139
- forEach ( states , function ( state ) { list . push ( state . self ) ; } ) ;
1140
- return list ;
1141
- }
1137
+ if ( arguments . length === 0 ) return objectKeys ( states ) . map ( function ( name ) { return states [ name ] . self ; } ) ;
1142
1138
var state = findState ( stateOrName , context ) ;
1143
1139
return ( state && state . self ) ? state . self : null ;
1144
1140
} ;
You can’t perform that action at this time.
0 commit comments