As mentioned on title, I have small issue to assign new variable with $rootScope
variable.
I have variable $rootScope.adulttotTicket
with value 2. the value is int
. So what I want is just to assign new variable newVal
to $rootScope.adulttotTicket
variable.
<p data-ng-init="newVal = $rootScope.adulttotTicket"></p>
but when I output variable newVal
, it show nothing on my browser. So I try to edit at plunker, so I found out the value newVal
is undefined. I don't have any idea what to do here.
newVal
should easily have value 2 from $rootScope.adulttotTicket
. but I got nothing. see on this plunkr plunkr
Hope get idea from anyone. thanks !