2016-12-21 22 views
0

は、私は、次のエラーを取得:エラーはなりませんので角度2 NPM開始エラー

import { BiddingService, Bid } from './bidding.service'; 
import { Component } from '@angular/core'; 
import * as Rx from 'rxjs/Rx'; 

@Component({ 
moduleId: module.id, 
selector: 'my-bidding', 
templateUrl: 'bidding.component.html' 
}) 

export class BiddingComponent { 


bidList = "No bids submitted yet"; 
highestBid = "0"; 
var popUpContainerDisplay = document.getElementById('popUpContainer'); 
var popUpAcceptContainerDisplay = document.getElementById('acceptPopUp'); 
var popUpDeclineContainerDisplay = document.getElementById('declinePopUp'); 
var popUpWarningContainerDisplay = document.getElementById('warningPopUp'); 
arrayReset = false; 


constructor(private biddingService: BiddingService) { 
    biddingService.bids.subscribe(bid => {  

     this.bidList = bid.bidderArrayText.join(''); 
     this.highestBid = bid.bidLabelMessage; 
     this.popUpContainerDisplay.style.display = bid.popUpContainerDisplay; 
     this.popUpContainerDisplay.style.opacity = bid.popUpContainerOpacity;       
     this.popUpAcceptContainerDisplay = bid.popUpAcceptContainerDisplay; 
     this.popUpDeclineContainerDisplay = bid.popUpDeclineContainerDisplay; 
     this.popUpWarningContainerDisplay = bid.popUpWarningContainerDisplay; 
     this.arrayReset = bid.arrayReset; 

    }); 
} 

sendToServer(): void{ 

var msgToServer = { 
    bid: document.getElementById('bidTextbox').value, 
    bidder: document.getElementById('bidderTextbox').value, 
    resetArrayBoolean: this.arrayReset; 
}; 

this.biddingService.bids.next(msgToServer); 
} 

popUpFadeOut(): void{ 
if(container.style.opacity == 0){ 
    container.style.opacity = 1; 
    container.style.display = "block"; 

    var fading = function fade() { 
     if ((container.style.opacity -= .01) <= 0) 
     { 
      container.style.dispaly = "none"; 
      container.style.opacity = 0; 
     } 
     else 
     { 
      requestAnimationFrame(fade); 
     } 
    } 

    setTimeout(fading, 1000); //popup box fades away after 1 seconds 
} 
} 

} 

app/bidding.component.ts(16,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. 
app/bidding.component.ts(23,22): error TS1005: ',' expected. 
app/bidding.component.ts(23,36): error TS1005: ',' expected. 
app/bidding.component.ts(23,54): error TS1005: ';' expected. 
app/bidding.component.ts(38,15): error TS1005: ';' expected. 
app/bidding.component.ts(40,9): error TS1005: ':' expected. 
app/bidding.component.ts(43,43): error TS1005: ',' expected. 
app/bidding.component.ts(44,6): error TS1005: ',' expected. 
app/bidding.component.ts(46,9): error TS1005: ':' expected. 
app/bidding.component.ts(46,47): error TS1005: ',' expected. 
app/bidding.component.ts(49,15): error TS1005: ';' expected. 
app/bidding.component.ts(50,14): error TS1005: ',' expected. 
app/bidding.component.ts(50,20): error TS1005: ',' expected. 
app/bidding.component.ts(50,29): error TS1005: '=' expected. 
app/bidding.component.ts(70,1): error TS1128: Declaration or statement expected. 

はここ入札コンポーネントです私の推測では、括弧や括弧に問題があることを確認していますが、私はチェックして何も見つけることができません。私は何を間違えたのですか?ありがとう。

+0

クラスの直下に 'var xxx'がありません。エラーメッセージに「予期しないトークンがあります。コンストラクタ、メソッド、アクセサまたはプロパティが必要です。これは16行目にあり、強いヒントを与えています。 –

+0

@JBNizetありがとう、私はそれを知らなかった。 – Jesper

答えて

1

コメント欄に記載されているように、角度2は、varの16行目以降の宣言を好きではありません。

関連する問題