locked
Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but cannot see changes RRS feed

  • Question

  • User-450582549 posted

    Hi

    Not sure what the problem is here or just my stupidity :-)

    Took a solution from GitHub to go about learning Angularjs with Asp.Net and the solution ran

    I updated the Index.html my controller.js  (all I am doing is running a different json file as input )

    but when I run thru Visual Studio with FireFox using Ctrl+F5 or just F5 - I see the  results before I made the change

    I have also tried Clean Solution and Rebuild solution with no luck and restarting the machine

    If I go to File Explorer and open Index.html with FireFox - I see the change I want

     

    Any ideas what may be going wrong or not getting updated ???

    Thanks

     

    Index.html

    ======

    <!DOCTYPE html>

    <html ng-app="mainApp" xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <title>MTG Browser</title>

    <link href="index.css" rel="stylesheet" />

    <script src="angular.min.js"></script>

    <script src="app.js"></script>

    <script src="cardsControllers.js"></script>

    </head>

    <body ng-controller="cardsListController">

    <h1>Cards</h1>

    <div id="cardsList">

    <div ng-repeat="card in cards" class="cardItem">

    <!--Card {{card.id}}-->

    Card {{card.name + ' ' + card.description}}

    </div>

    </div>

    </body>

    </html>

     

    Controller.js

    ----------------------------

    var cardsControllers = angular.module('cardsControllers', []);

    cardsControllers.controller('cardsListController', ['$scope', '$http', function ($scope, $http) {

       //$http.get('all.json').success(function (data) {

        $http.get('cards.json').success(function (data) {

           var cards = [];

            angular.forEach(data,function(block) {

                angular.forEach(block.expansions,function(expansion) {

                    angular.forEach(expansion.cards,function(card) {

                        cards.push(card);

                    });

                });

            });

           $scope.cards = cards;

        });

    }]);

    Friday, July 18, 2014 11:59 AM

All replies

  • User1918509225 posted

    Hi samoc,

    First, i suggest that you add an sentence to your html page, see if it still can not be shown in your page

    Second, i suggest that set a breakpoint on your javascript file ,debug it on your visual studio,see if it has

    any error message.

    Best Regards,

    Kevin Shen.

    Sunday, July 20, 2014 11:24 PM
  • User-450582549 posted

    Hi

    If I add some text to HTML page it displayes the change if I Right-Click on index.html and open in FireFox

    If I F5 in Visual Studio it does not show change and AngularController is not running or Collection is not displaying by the  ng-repeat directive

     

    Thanks

    Tuesday, July 22, 2014 3:19 PM
  • User1918509225 posted

    Hi samoc,

    It is really weird even after you clean and rebuild your solution.

    Since you have mentioned that you download your project from github,if you don't mind ,please share a link for me .

    So that I try to recreate your problem in my computer.

    Best Regards,

    Kevin Shen.

    Wednesday, July 23, 2014 3:54 AM
  • User1082734430 posted

    I believe this line - <html ng-app="mainApp" xmlns="http://www.w3.org/1999/xhtml"> causing the problem there.

    try with this - <html ng-app="cardsControllers" xmlns="http://www.w3.org/1999/xhtml">

     

    Monday, September 8, 2014 11:13 AM
  • User-553092765 posted

    I think you should let this section before your </body> tag

    <script src="angular.min.js"></script>
    
    <script src="app.js"></script>
    
    <script src="cardsControllers.js"></script>

    Friday, October 24, 2014 4:34 AM
  • User1795871164 posted

    Well it's quite a while since the question was asked,, nonetheless I ran into this problem too.

    I overcame this problem by making sure the browser cache was empty, CTRL-F5 in IE

    The broswer is a sophisticated piece of software.

    Saturday, February 7, 2015 10:28 AM