Last post Feb 07, 2015 10:28 AM by Rossiemalo
None
0 Points
10 Posts
Jul 18, 2014 11:59 AM|samoc|LINK
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>
</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;
}]);
All-Star
16806 Points
2777 Posts
Jul 20, 2014 11:24 PM|Kevin Shen - MSFT|LINK
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.
Jul 22, 2014 03:19 PM|samoc|LINK
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
Jul 23, 2014 03:54 AM|Kevin Shen - MSFT|LINK
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.
Member
370 Points
305 Posts
Sep 08, 2014 11:13 AM|abhijithmanipal|LINK
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">
1 Post
Oct 24, 2014 04:34 AM|chikien276|LINK
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>
Feb 07, 2015 10:28 AM|Rossiemalo|LINK
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.
None
0 Points
10 Posts
Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but cann...
Jul 18, 2014 11:59 AM|samoc|LINK
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;
});
}]);
All-Star
16806 Points
2777 Posts
Re: Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but...
Jul 20, 2014 11:24 PM|Kevin Shen - MSFT|LINK
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.
None
0 Points
10 Posts
Re: Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but...
Jul 22, 2014 03:19 PM|samoc|LINK
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
All-Star
16806 Points
2777 Posts
Re: Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but...
Jul 23, 2014 03:54 AM|Kevin Shen - MSFT|LINK
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.
Member
370 Points
305 Posts
Re: Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but...
Sep 08, 2014 11:13 AM|abhijithmanipal|LINK
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">
None
0 Points
1 Post
Re: Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but...
Oct 24, 2014 04:34 AM|chikien276|LINK
I think you should let this section before your </body> tag
None
0 Points
1 Post
Re: Strange behavior with Angularjs and VisualStudio 2013 - Update Index.Html and Controller but...
Feb 07, 2015 10:28 AM|Rossiemalo|LINK
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.