Clarifying the question for better understanding.
Plunkr
Preview:
<input type="text" ng-model="form['data']['sampleData']">
<input type="text" ng-model="form[bindingPrefix][bindingSuffix]">
<input type="text" ng-model="form[bindingValue]">
Controller:
$scope.form = {
data: {
sampleData: '123'
}
};
$scope.bindingValue = 'data.sampleData';
$scope.bindingPrefix = 'data';
$scope.bindingSuffix = 'sampleData';
Intended outcome:
I anticipate that form[bindingValue]
will produce the same result as
form[bindingPrefix][bindingSuffix]</code without manually splitting <code>bindingValue
into bindingPrefix
and bindingSuffix</code since bindingValue can be a dynamic value like <code>data.sampleData.childData
, data.sampleData.childData.childChildData
in an array for ng-repeat the model.
Note: bindingValue is a value passed from Server side over which I have no control.
========================================================================== This Plunkr might offer a solution. It is preferable not to modify the view if possible.Click here