angularjs - Some misunderstanding of this keyword in Angular controller -
i learning angularjs.and have missunderstandig on example:
(function () { "use strict"; angular.module("productmanagement").controller("productlistctrl", productlistctrl); function productlistctrl() { var vm = this; vm.products = [ { "productid": 1, "productname": "leaf rake", "productcode": "gdn-0011", "releasedate": "march 19, 2009", "description": "leaf rake 48-inch wooden handle.", "price": 19.95 }, { "productid": 2, "productname": "garden cart", "productcode": "gdn-0023", "releasedate": "march 18, 2010", "description": "15 gallon capacity rolling garden cart", "price": 32.99 }, { "productid": 5, "productname": "hammer", "productcode": "tbx-0048", "releasedate": "may 21, 2013", "description": "curved claw steel hammer", "price": 8.99 }, { "productid": 8, "productname": "saw", "productcode": "tbx-0022", "releasedate": "may 15, 2009", "description": "15-inch steel blade hand saw", "price": 11.55 }, { "productid": 10, "productname": "video game controller", "productcode": "gmg-0042", "releasedate": "october 15, 2002", "description": "standard two-button video game controller", "price": 35.95 } ]; } }());
what meaning of row:
**var vm = this;**
any explanation please meaning of this keyword in current context?
Comments
Post a Comment