2016-12-15 84 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' 
    } 
};