i'm pretty new angular 2 , trying simple sign-in buttons work inside 1 of child-components.
this order of scripts rendered:
<html> <head> <title>title</title> <meta name="google-signin-client_id" content="xxxxxxx.apps.googleusercontent.com"> <script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/systemjs/dist/system-polyfills.js"></script> <script src="node_modules/angular2/es6/dev/src/testing/shims_for_ie.js"></script> <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="node_modules/rxjs/bundles/rx.js"></script> <script src="node_modules/angular2/bundles/angular2.dev.js"></script> <script src="https://apis.google.com/js/platform.js" async defer></script> <script> system.config({ packages: { app: { format: 'register', defaultextension: 'js' } } }); system.import('app/main') .then(null, console.error.bind(console)); </script> </head> <body> <my-app>loading...</my-app> </body> </html>
if place inside main-component so, not rendering @ all:
import {component} 'angular2/core'; @component({ selector: 'my-app', template: '<div class="g-signin2" data-onsuccess="onsignin"></div>' }) export class appcomponent { }
if instead place button directly in body of index.html, button rendered js-library displayed correctly.
the div there when inspect element, seems button trying render before script loaded, since not displaying.
any idea why happening , how can fix it?
thanks input!
Comments
Post a Comment