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
// TypeScript types | |
function myFn(name:string, obj:MyClass) { | |
// ... | |
} | |
// Equivalent ES5 | |
/** | |
* @param name {string} | |
* @param obj {MyClass} | |
*/ |
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
// AtScript types | |
function myFn(name:string, obj:MyClass) { | |
// ... | |
} | |
// Equivalent ES5 | |
/** | |
* @param name {string} | |
* @param obj {MyClass} | |
*/ |
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
// Annotation in AtScript | |
@MyAnnotation({a: 'b'}) | |
function fn() {} | |
// Equivalent ES5 | |
function fn() {} | |
fn.annotations = [new MyAnnotation({a: 'b'})]; |
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
angular.module('myApp', []).directive('myComponent', function() { | |
return { | |
scope: true, | |
controller: function() { | |
this.myProperty = 'myValue'; | |
this.myMethod = function() { | |
return 'myResult'; | |
}; | |
}, | |
controllerAs: 'myComponent' |
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
<script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script> | |
<script src="bower_components/traceur/traceur.js"></script> | |
<script src="bower_components/es6-module-loader/dist/es6-module-loader.js"></script> | |
<script src="bower_components/system.js/dist/system.js"></script> | |
<script src="system.config.js"></script> | |
<script> | |
System.import('app').then(function() { | |
angular.bootstrap(document, ['myApp']); | |
}); |
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
// Configure module loader | |
System.config({ | |
baseURL: '/app/', | |
// Set paths for third-party libraries as modules | |
paths: { | |
'angular': 'bower_components/angular/angular.js', | |
'angular-route': 'bower_components/angular-route/angular-route.js' | |
} | |
}); |
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
'use strict'; | |
import 'angular'; | |
import 'angular-route'; | |
import './components/version/version'; | |
import './components/version/interpolate-filter'; | |
import './components/version/version-directive'; | |
import './view1/view1'; | |
import './view2/view2'; | |
// Declare app level module which depends on views, and components |
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
var builder = require('systemjs-builder'), | |
path = require('path'); | |
// load SystemJS config from file | |
builder.loadConfig('./app/system.config.js') | |
.then(function() { | |
// Change baseURL to match the file system | |
builder.config({ baseURL: path.resolve('./app') }); | |
// Build a self-executing bundle (ie. Has SystemJS built in and auto-imports the 'app' module) |
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
<script src="bower_components/traceur-runtime/traceur-runtime.min.js"></script> | |
<script src="bundle.js"></script> |
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
// Add 'karma-systemjs' to the list of plugins | |
plugins: ['karma-systemjs', ...], | |
// Add 'systemjs' to the list of frameworks | |
frameworks: ['systemjs', 'jasmine'], | |
// Move all the `files` to `systemjs.files` | |
files: [], | |
systemjs: { |