Last active
December 17, 2015 20:58
-
-
Save JensRantil/5670869 to your computer and use it in GitHub Desktop.
Trying to recreate https://github.com/angular/angular.js/issues/2815
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Can't be tested locally due to same origin policies. I used Python's | |
SimpleHTTPServer for serving this: | |
$ python -m SimpleHTTPServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application 1's first template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application 1's second template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Your name is {{name}}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Reproduce #2825</title> | |
<script | |
src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" | |
type="text/javascript"></script> | |
<script | |
src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.6/angular.min.js"></script> | |
<script> | |
angular.module("app1", []) | |
.config(function($routeProvider) { | |
$routeProvider | |
.when('/page1', { | |
templateUrl: | |
'./app1-template1.html', | |
}) | |
.when('/page2', { | |
templateUrl: | |
'./app1-template2.html', | |
}) | |
.otherwise({redirectTo: '/page1'}); | |
}); | |
angular.module("app2", []) | |
.controller("Controller1", function($scope) { | |
$scope.name = "Arnold"; | |
}) | |
.controller("Controller2", function($scope) { | |
$scope.name = "Anna"; | |
}); | |
jQuery(function() { | |
angular.bootstrap(jQuery('#app1').get(), | |
['app1']); | |
angular.bootstrap(jQuery('#app2').get(), | |
['app2']); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="app1"> | |
<a href="#/page1">Page1</a> | |
<a href="#/page2">Page2</a> | |
<div ng-view></div> | |
</div> | |
<div id="app2"> | |
<div data-ng-controller="Controller1" data-ng-include | |
src="'app2-template1.html'"></div> | |
<div data-ng-controller="Controller2" data-ng-include | |
src="'app2-template1.html'"></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment