Created
June 3, 2015 00:46
-
-
Save morrissinger/a45ceb74ab078c0b14cf to your computer and use it in GitHub Desktop.
Angular 1 with ECMAScript 6, JSPM, and SystemJS
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
export class ApplicationController { | |
constructor() { | |
this.foo = 'bar'; | |
} | |
} |
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
import 'angular-ui-router'; | |
import { ApplicationController } from './controllers/application-controller'; | |
import tpl from 'modules/application/templates/application-template.html!' | |
angular.module('Application', ['ui.router']) | |
.config(($stateProvider) => { | |
$stateProvider.state('home', { | |
url: '/home', | |
views: { | |
application: { | |
template: tpl, | |
controller: ApplicationController, | |
controllerAs: 'controller' | |
} | |
} | |
}); | |
}) | |
.controller('ApplicationController', ApplicationController); |
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
Hello, {{controller.foo}}! |
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
export function instantiate(load) { | |
return load.source; | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="styles/styles.css"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<ui-view name="application"></ui-view> | |
<script src="jspm_packages/system.js"></script> | |
<script src="config.js"></script> | |
<script> | |
System.config({ | |
"paths": { | |
"*": "dist/*.js" | |
} | |
}); | |
</script> | |
<script> | |
System.import('index'); | |
</script> | |
</body> | |
</html> |
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
import angular from 'angular'; | |
import 'modules/application/application-module'; | |
angular.element(document).ready(function() { | |
angular.bootstrap(document, ['Application']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment