C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
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.4
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