Hi Sander
Thanks for your inputs and each and every word make sense. I changed
<button type="button" ng-click="count = count + 1; friendName =
friends[count].name" ng-init="count=0;friendName=''">
Click Me!
</button>
<br>
friendName: {{ friendName }}
and on each click now I can see the friendName from ng-init.
Thanks
Rajan
On Tuesday, December 22, 2015 at 1:15:15 AM UTC-5, Sander Elias wrote:
> Hi Raj,
>
> You did work your way through the tutorial?
>
> Ok, an expression is NOT javascript. things like alert, and console.log
> are not available to you. Only functions that are available on the current
> scope are. As you did not define an app, nor a controller, you only have
> the rootScope available. there is very little functionality available
> there.
> This means that in your ng-click, console.log, or alert, or any other
> javascript function will silently fail.
> Then for your on-click handler. There you have everything available that
> JS offers, but you have no access to the scope. For security reasons,
> angular does NOT compile expressions that are attached to DOM event
> handlers.
>
> Regards
> Sander
>
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.