angularjs - Angular js not updating local files -
i had angular app running fine last night, after opening tonight, app runs, changes made on files i.e store.controller.js
, store.html
no longer take effect time.
for example:
<h1>{{product.name}}</h1> var item = [{ name: 'shoe' }]
should output "shoe". though, doesn't, it'll list old variable. 'find me'.
it's no longer updating controller properly. ideas? can list more code if preferred.
//store.html <div class="store-block"> <div ng-repeat="product in products" ng-show="product.canpurchase" class="item-panel"> <h1 class="pull-left">no expression</h1> <h2 class="pull-right">{{product.price | currency}}</h2> <div class="product-image clearfix"> <img ng-src="{{product.images[0]}}" /> </div> <section> <ul class="nav nav-pills pull-right clearfix"> <li> <a ng-click="panelctrl.isselected(1)" href>help</a></li> <li> <a href>colors</a></li> <li> <a href>reviews</a></li> </ul> <div class="panel"> <h3>description</h3> <span class="pull-right" ng-hide="desc.element">{{product.category}}</span> <span class="pull-right" ng-hide="desc.element">stock {{product.stock}}</span> <p class="clearfix" ng-hide="desc.element">{{product.description}}</p> </div> <div class="panel" > <h3>colors</h3> <p>{{product.colors[0]}}</p> </div> </div> </section> </div> </div>
store.controller.js
'use strict'; angular.module('angularstoreapp') .controller('storectrl', function ($scope, $http) { var item = [ { name: 'hello', price: 3.52, description: 'hi soulless creaturas, imo monstra adventus vultus comedat cerebella viventium. qui offenderit rapto, terribilem incessu.', category: 'sandels', stock: 1, canpurchase: true, images: [ "assets/images/yeoman.png", "http://billypurvis.co.uk/wp-content/uploads/2015/06/acta.png" ], colors: [ //add image"blue", //add image"brown" ] }, { name: 'shoe 2', price: 4.56, description: 'zombies reversus ab inferno, nam malum cerebro. de carne animata corpora quaeritis. summus sit, morbo vel maleficia? de apocalypsi undead dictum mauris.', category: 'tie up', stock: 32, canpurchase: true, images: [ "http://billypurvis.co.uk/wp-content/uploads/2015/06/acta.png" ], colors: [ //add image"blue", //add image"brown" ] } ]; $scope.products = item; });
the out put still results in 'hello', when shouldn't output anywhere. i've cleared cache, saved files, restarted grunt serve. 1 have ideas?
if helps, i'm using webstorm ide.
one thing keep in mind while working angularjs clear cache , try them. because make right change, check it, works. come , change again , run application , still work since data sitting in dom. clear cache every time before , after changes.
also use browser debugger(console) check errors.
Comments
Post a Comment