Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
ng-init Directive In AngularJs
WhatsApp
Ajay Malik
Aug 01
2016
594
0
0
ng-init directive
ng-init directive is used to define default value in AngularJs
Example
<!DOCTYPE html
>
<
html
>
<
script
src
=
"http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"
>
</
script
>
<
body
>
<
div
ng-app
=
""
ng-init
=
"a=1;b=5"
>
<
p
>
Total in dollar: {{ a+ b}}
</
p
>
</
div
>
</
body
>
</
html
>
AngularJS
ng-init Directive
Up Next
ng-init Directive In AngularJs