Home Updating the view with respect to number of clicks in angularjs
Reply: 0

Updating the view with respect to number of clicks in angularjs

user1376
1#
user1376 Published in April 26, 2018, 1:43 pm

I want to update my view(an input form) to add products to database. For a single product I am able to add it by making it into an array, but now I want to add multiple products and with the click of a button "Add more Product", a similar view(form) is to be generated below the existing form, and this can go on multiple times(to be determined at run time). Now I have two problems: 1. How to update my view with every (Add more Product)button click. Is it done by maintaining some count? 2. How to add multiple product values from each of the forms into the the array of object.

$scope.onClick = function () {
                        $scope.productData =
                                {
                                    name: $scope.name,
                                    description: $scope.description,
                                    price: $scope.price,
                                    image: $scope.image,
                                    tags: $scope.tags,
                                    partner_id: $scope.partner_id,

                                };
                                }

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.464761 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO