我試圖運行「離子cordova運行android - 生產」但我在我的終端中出現以下錯誤。IONIC 2:錯誤:意外的令牌:名稱(玩家)在線26325,列4,位置888867
[19:33:28] uglifyjs started ... [WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date. Error: Unexpected token: name (Players) in /Volumes/Macintosh Data/IONIC_PROJECT/hukulele/www/build/main.js at line 26325, col 4, pos 888867 Here is my Players class :
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
@Injectable()
export class Players{
players: {name: string}[];
addPlayer(player: {name: string}){
this.players.push(player);
}
getPlayers(){
return this.players.slice();
}
setPlayers(liste: {name: string}[]){
this.players = liste;
}
initPlayers(){
this.players = [{"name":""},{"name":""},{"name":""},{"name":""},{"name":""}];
}
}
而main.js文件在行26325:
let Players = class Players {
addPlayer(player) {
this.players.push(player);
}
getPlayers() {
return this.players.slice();
}
setPlayers(liste) {
this.players = liste;
}
initPlayers() {
this.players = [{ "name": "" }, { "name": "" }, { "name": "" }, { "name": "" }, { "name": "" }];
}
};
請幫幫忙!
謝謝!你救我 –