Created
July 22, 2016 07:06
-
-
Save hitenpratap/fd321239d3650dba0706f40fa9bdab79 to your computer and use it in GitHub Desktop.
How to use variables with $scope in angularjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Lets assume value.questionUniqueId is coming from json response | |
var dataModel = $parse('data_' + value.questionUniqueId); | |
var dataModel1 = $parse(value.questionUniqueId + '_data'); | |
var labelsModel = $parse('labels_' + value.questionUniqueId); | |
var seriesModel = $parse('series_' + value.questionUniqueId); | |
dataModel.assign($scope, ['1', '2', '3', '4', '5']); | |
dataModel1.assign($scope, ['1', '2', '3', '4', '5']); | |
labelsModel.assign($scope, [ | |
[3, 0, 1, 4, 6] | |
]); | |
seriesModel.assign($scope, ['Series A']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment