0

Is there any way that I can get angular variable value as below syntax.?

var iNumber= "$scope.RegionLineNumber"
Keval Raj
  • 69
  • 2
  • 10

2 Answers2

1

why you want to do this. If you want to get in string format then you can use $scope.RegionLineNumber.toString();

yasir_mughal
  • 112
  • 10
0

You can use eval (read this and this before)

var iNumber = eval("$scope.RegionLineNumber");

however there's certainly a better way to do that. For example, if you know it's in $scope, just use

var iNumber = $scope["RegionLineNumber"];
baao
  • 71,625
  • 17
  • 143
  • 203