-1

Is there any way to differentiate a scope variable declared from controller or using ng-model directive? How can I differentiate them in code?

Example

$scope.testScopeVar & `ng-model="testVal"

I'm really curious to know, Is there any way to do it so?

Pankaj Parkar
  • 134,766
  • 23
  • 234
  • 299

1 Answers1

1

I'm pretty sure the answer is no, you cannot distinguish the origin of scope variables programmatically. Once they are on the scope, they are Plain Old JavaScript Objects. The best you can do would be to establish a naming convention and adhere to it in your own application code.

Peter Lyons
  • 142,938
  • 30
  • 279
  • 274