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
Adding Item Using Add Item In AngularJS
WhatsApp
Ajay Malik
Aug 22
2016
1.3
k
0
0
<!DOCTYPE html
>
<
html
>
<
script
src
=
"http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"
>
</
script
>
<
body
>
<
h1
>
c# corner
</
h1
>
<
script
>
var
app
=
angular
.module("myShoppingList", []);
app.controller("myCtrl", function($scope) {
$
scope.products
= ["python", "ios", ".net"];
$
scope.addItem
=
function
() {
$scope.products.push($scope.addMe);
}
});
</
script
>
<
div
ng-app
=
"myShoppingList"
ng-controller
=
"myCtrl"
>
<
ul
>
<
li
ng-repeat
=
"x in products"
>
{{x}}
</
li
>
</
ul
>
<
input
ng-model
=
"addMe"
>
<
button
ng-click
=
"addItem()"
>
Add technology
</
button
>
</
div
>
<
p
>
write technology to add in list.
</
p
>
</
body
>
</
html
>
AngularJS
Up Next
Adding Item Using Add Item In AngularJS