gefunden ich einen Fehler mit Winkeln Meteor Tutorial bekommen, auf Schritt 3 (here)Winkel Meteor - Fehler mit angular2-Meteor-Auto-Bootstrap - Keine Richtlinie Anmerkung auf
Wenn ich versuche zu tun:
import {bootstrap} from 'angular2-meteor-auto-bootstrap';
bootstrap(Socially);
ich diesen Fehler in meinem Browser:
EXCEPTION: No Directive annotation found on Socially
Hier ist mein Code:
Client/app.ts
import 'reflect-metadata';
import 'zone.js/dist/zone';
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2-meteor-auto-bootstrap';
import {Parties} from '../collections/parties';
import {Tracker} from 'meteor/tracker';
import {Mongo} from "meteor/mongo";
@Component({
selector: 'app',
templateUrl: 'client/app.html'
})
class Socially {
parties: Mongo.Cursor<Object>;
constructor() {
this.parties = Parties.find();
}
}
bootstrap(Socially);
Client/app.html
<p>Liste of parties:</p>
<div>
<ul>
<li *ngFor="let party of parties">
{{party.name}}
<p>{{party.description}}</p>
<p>{{party.location}}</p>
</li>
</ul>
</div>
Sammlungen/parties.ts
import {Mongo} from 'meteor/mongo';
export let Parties = new Mongo.Collection('parties');
server/main.ts
import {loadParties} from './load-parties';
import {Meteor} from 'meteor/meteor';
Meteor.startup(loadParties);
Server/Last-parties.ts
import {Parties} from '../collections/parties';
export function loadParties() {
if (Parties.find().count() === 0) {
var parties = [
{
'name': 'Dubstep-Free Zone',
'description': 'Can we please just for an evening not listen to dubstep.',
'location': 'Palo Alto'
},
{
'name': 'All dubstep all the time',
'description': 'Get it on!',
'location': 'Palo Alto'
},
{
'name': 'Savage lounging',
'description': 'Leisure suit required. And only fiercest manners.',
'location': 'San Francisco'
}
];
for (var i = 0; i < parties.length; i++) {
Parties.insert(parties[i]);
}
}
};
Und hier ist meine Konfiguration:
package.json
{
"name": "socially",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"angular2": "2.0.0-rc.1",
"angular2-google-maps": "0.9.0",
"angular2-meteor": "^0.5.5",
"angular2-meteor-accounts-ui": "0.3.5",
"angular2-meteor-auto-bootstrap": "^0.5.5",
"angular2-pagination": "0.1.1",
"collections": "^3.0.0",
"ionic-webpack-package": "^1.0.0",
"meteor-node-stubs": "^0.2.3",
"ng2-material": "0.2.12",
"reflect-metadata": "^0.1.2",
"rxjs": "5.0.0-beta.6"
}
}
tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true,
"module": "commonjs",
"target": "es5",
"isolatedModules": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"removeComments": false,
"noImplicitAny": false,
"sourceMap": true
},
"filesGlob": [
"client/**/*.ts",
"server/**/*.ts",
"typings/**/*.d.ts"
],
"exclude": [
"node_modules"
]
}
typings.json
{
"name": "socially",
"version": false,
"dependencies": {
"es6-promise": "registry:npm/es6-promise#3.0.0+20160211003958"
},
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"
}
}
Schließlich, hier ist der Befehl, den ich verwendet:
meteor create socially
cd socially
meteor npm install --save meteor-node-stubs angular2
meteor add angular2-compilers
meteor add barbatus:angular2-runtime
meteor npm install --save angular2-meteor
meteor remove blaze-html-templates
npm install typings -g
typings init
typings install es6-promise --save
typings install es6-shim --ambient --save
typings install registry:env/meteor --ambient
meteor npm install angular2-meteor-auto-bootstrap --save
Und meine Tools Version:
npm -v
3.8.6
meteor --version
Meteor 1.3.2.4
meteor list
angular2-compilers 0.5.6
autopublish 1.0.7
barbatus:angular2-runtime 0.2.3_2
ecmascript 0.4.3
es5-shim 4.5.10
insecure 1.0.7
jquery 1.11.8
meteor-base 1.0.4
mobile-experience 1.0.4
mongo 1.1.7
reactive-var 1.0.9
standard-minifier-css 1.0.6
standard-minifier-js 1.0.6
tracker 1.0.13
Ich bin Arbeiten unter Windows 8.
Für mehrere Tage suchte ich nach einer Lösung, aber ich kann keine finden!
Danke für Ihre Hilfe.
Vielen Dank! Dies löst mein Problem, du bist ein Lebensretter :) Ich mochte in Ihrem Link, ich entferne angular2 und installiere angular RC1 und ich ändere meinen Import der Komponente auf app.ts von "angular2/core" zu "@ angular/Ader". –