Closed ghost closed 8 years ago
@robertbaker, if this is still actual for you :) try
jspm install angular2-now=github:pbastowski/angular2-now -o "{shim: {'angular2-now': ['angular']}}"
or add
"overrides": {
"github:pbastowski/angular2-now@master": {
"shim": {
"angular2-now": [
"angular"
]
}
}
}
directly to jspm in package.json and then reinstall the package
@mbutsykin thanks, maybe I'll try it out someday.
I ended up writing a "Module" class that removes a lot of the boilerplate and stuff. Does a lot of what this does, except no decorators. I hope I can revisit this and implement it.
@robertbaker
The following SystemJS config works:
System.config({
defaultJSExtensions: false,
transpiler: "typescript",
"paths": {
"*": "*.ts"
},
map: {
"angular": "/node_modules/angular/angular.js",
"angular2now": "/node_modules/angular2-now/dist/angular2-now.js"
}
});
System.import('app')
Then in app.ts
you can do
import { SetModule, Component, Inject, bootstrap } from 'angular2now';
SetModule('app', []);
@Component({
selector: 'app',
template: '<h1>angular2-now Application</h1>',
services: ['$http']
})
//@Inject('$http')
class App {
constructor($http) {
console.log('@ app: $http: ', $http);
}
}
bootstrap(App);
Also, see my test repo https://github.com/pbastowski/test-02.
Closing this issue, but feel free to reopen if required.
jspm install npm:angular2-now
In my config.js
in my appModule
'use strict'; import 'angular'; import 'angular-ui-router'; import {Component, View, Inject, options} from 'angular2now'; import {Component, View, Inject, options} from 'angular2-now' // tried this too; angular2now.options({controllerAs: 'vm'});
Made no difference.
I think you need to add format: "amd" to the package.json.
It may need to be
jspm: {format: "amd"}
I manually changed it in jspm_packages, but now it complains about
Edit:
I installed
jspm install github:pbastowski/angular2-now
Still getting this error: