Testing jspm and systemjs

This commit is contained in:
Jonathan Cremin 2015-06-14 20:13:57 +01:00
parent 3a8421816a
commit 60f90817ad
4 changed files with 612 additions and 17 deletions
views

View file

@ -20,7 +20,9 @@ var App = React.createClass({
<body className='home'>
<RouteHandler {...this.props} />
<GAInitiailizer />
<script src='/scripts/bundle.js' />
<script src='jspm_packages/system.js'></script>
<script src='config.js'></script>
<script dangerouslySetInnerHTML={{__html: 'System.import(\'views/app.jsx\');'}}></script>
</body>
</html>
);
@ -35,18 +37,17 @@ var routes = (
</Route>
);
module.exports.routes = routes;
if (typeof window !== 'undefined') {
window.onload = function() {
Router.run(routes, Router.HistoryLocation, function (Handler) {
if (typeof window.recents !== 'undefined') {
React.render(<Handler recents={window.recents} />, document);
} else if (typeof shares !== 'undefined') {
React.render(<Handler shares={window.shares} />, document);
}
});
ga('create', 'UA-66209-8', 'auto');
ga('send', 'pageview');
};
console.log("HEREER")
Router.run(routes, Router.HistoryLocation, function (Handler) {
if (typeof window.recents !== 'undefined') {
React.render(<Handler recents={window.recents} />, document);
} else if (typeof shares !== 'undefined') {
React.render(<Handler shares={window.shares} />, document);
}
});
ga('create', 'UA-66209-8', 'auto');
ga('send', 'pageview');
}
module.exports.routes = routes;