2016-12-15 64 views
0

荫现在在这里做我的第一个角2流星tutroial当是链接:错误编译官方Angular2流星教程

https://angular-meteor.com/tutorials/socially/angular2/3-way-data-binding

在首信4.3绑定蒙戈观察到....

我代码看起来像这样:

export class AppComponent { 

parties: Observable<any[]>; 

constructor() {  
this.parties = Parties.find({}).zone(); 

    {'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' 
    }, 
    }; 
    } 

现在我去到控制台,启动本地主机的我得到这个错误:

01在11和16之间的界限
While building for web.browser: 
client/imports/app/app.component.ts:16:11: ';' expected. 

Your application has errors. Waiting for file change. 

是在我的代码:

export class AppComponent { 

parties: Observable<any[]>; 

constructor() {  
this.parties = Parties.find({}).zone(); 

    {'name': 'Dubstep-Free Zone' 
    'description': 'Can we please just for an evening not listen to dubstep.' 
在此行逗号预计

和地方,但我不知道在哪里。 谢谢你的帮助;)

回答

0

你错过了对象的开始。我增加了行

var something = { 

教程可能想别的东西。

在构建列表时,您还需要在每行结尾处使用逗号,并且在末尾没有逗号(尽管ES6容忍这种情况)。这就是你的代码的样子。

export class AppComponent { 

parties: Observable<any[]>; 

constructor() {  
this.parties = Parties.find({}).zone(); 

var something = { 
    {'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' 
    } 
};