expandProperties (pattern, callback) private
Expands pattern
, invoking callback
for each expansion.
The only pattern supported is brace-expansion, anything else will be passed once to callback
directly.
Example
1 2 3 4 5 6 7 8 9 | function echo(arg){ console.log(arg); } Ember.expandProperties( 'foo.bar' , echo); //=> 'foo.bar' Ember.expandProperties( '{foo,bar}' , echo); //=> 'foo', 'bar' Ember.expandProperties( 'foo.{bar,baz}' , echo); //=> 'foo.bar', 'foo.baz' Ember.expandProperties( '{foo,bar}.baz' , echo); //=> 'foo.baz', 'bar.baz' Ember.expandProperties( 'foo.{bar,baz}.[]' , echo) //=> 'foo.bar.[]', 'foo.baz.[]' Ember.expandProperties( '{foo,bar}.{spam,eggs}' , echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs' Ember.expandProperties( '{foo}.bar.{baz}' ) //=> 'foo.bar.baz' |
Parameters:
-
pattern
String
- The property pattern to expand.
-
callback
Function
- The callback to invoke. It is invoked once per expansion, and is passed the expansion.
Please login to continue.