TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
AngularJs: Button Click Event Using ng-click Directive
Yogendra Yadav
Jan 16
2016
Code
4
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<script type=
"text/javascript"
src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"
></script>
<script type=
"text/javascript"
>
var app = angular.module(
'MyApp'
, [])
app.controller(
'MyController'
, function($scope)
{
$scope.BtnClick = function()
{
$scope.Msg =
"clicked Button"
}
});
</script>
<div ng-app=
"MyApp"
ng-controller=
"MyController"
>
<input type=
"button"
value=
"Click Me!"
ng-click=
"BtnClick()"
/>
<br />
<br />
<label ng-bind=
"Msg"
>
</Label>
</div>
AngularJS
JavaScript
Button Click Event Using ng-click Directive