File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010 < base href ="/ ">
1111
12- < script src ="modules/bower_components/webcomponentsjs/webcomponents.min.js "> </ script >
13-
14-
12+ < script src ="modules/bower_components/webcomponentsjs/webcomponents-lite.js "> </ script >
1513 < script src ="src/assets/web/assets/jquery/jquery.min.js "> </ script >
1614 < script src ="modules/angularjs/1_5/angular.js "> </ script >
1715 < script src ="modules/angularjs/1_5/angular-route.js "> </ script >
Original file line number Diff line number Diff line change 4747
4848 </ section >
4949</ template >
50- < script > registerComponent ( "hw2site-header" ) </ script >
50+ < script >
51+ registerComponent ( "hw2site-header" )
52+ </ script >
Original file line number Diff line number Diff line change @@ -28,15 +28,16 @@ app.run(function($rootScope) {
2828 } ) ;
2929} ) ;
3030
31- function registerComponent ( name , withShadow ) {
32- var mainDoc = document . currentScript . ownerDocument ;
33-
31+ function registerComponent ( name , withShadow ) {
32+ // native : polyfill
33+ var mainDoc = document . _currentScript ? document . _currentScript . ownerDocument : document . currentScript . ownerDocument ;
34+
3435 var proto = Object . create ( HTMLElement . prototype ) ;
3536
36- proto . createdCallback = function ( ) {
37+ proto . createdCallback = function ( ) {
3738 var element = withShadow === true ? this . createShadowRoot ( ) : this ;
3839 // Grab DOM from doc.html's document.
39- var text = mainDoc . querySelector ( "#" + name ) ;
40+ var text = mainDoc . querySelector ( "#" + name ) ;
4041 element . innerHTML = text . cloneNode ( true ) . innerHTML ;
4142 } ;
4243
You can’t perform that action at this time.
0 commit comments