I want to use angular' mechanism for deep property nesting , something that ng-model
directive is using. I mean we can create very "deep" object in a scope by writing : ng-model="data.obj1.prop2.attr3.value4.text"
in a view , so i want to do it easily in a controller/service too. I don't want to reinvent a wheel (or use this or this). Is there something undocumented like angular.create(path_str)
?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Do the Java Integer and Double objects have unnece
- Keeping track of variable instances
One way you can achieve is by using
$parse
service. It hasgetter
andsetter
function that i think can handle what you wantSee this fiddle http://jsfiddle.net/cmyworld/m7gxn/
And i think this also works