不允许使用Angular 2声明公共实例成员变量

时间:2016-09-01 12:56:27

标签: angularjs angular npm

以下是我收到的错误图片的链接: https://snag.gy/JnDOq1.jpg

以下是导致错误的代码图像的链接: https://snag.gy/XtBU6y.jpg

我在我的组件中有一个json对象数组,我在我的组件中循环。它在localhost中工作正常,但是当我尝试构建生产时,我收到此错误:

[12:46:56] Starting 'build.prod'...
[12:46:56] Starting 'clean.prod'...
[12:46:56] Deleted dist/prod
[12:46:56] Deleted dist/tmp
[12:46:56] Finished 'clean.prod' after 5.82 ms
[12:46:56] Starting 'tslint'...
app/home/home.component.ts[34, 5]: Declaration of public instance member     variable not allowed to appear after declaration of public instance member function
app/home/home.component.ts[17, 17]: block is empty
app/home/home.component.ts[21, 1]: trailing whitespace
app/home/home.component.ts[34, 13]: trailing whitespace
app/home/home.component.ts[44, 15]: trailing whitespace
app/home/home.component.ts[52, 15]: trailing whitespace
app/home/home.component.ts[60, 15]: trailing whitespace
app/home/home.component.ts[68, 15]: trailing whitespace
app/home/home.component.ts[76, 15]: trailing whitespace
app/home/home.component.ts[84, 15]: trailing whitespace
app/home/home.component.ts[92, 15]: trailing whitespace
app/home/home.component.ts[100, 15]: trailing whitespace
app/home/home.component.ts[108, 16]: trailing whitespace
app/home/home.component.ts[116, 16]: trailing whitespace
etc

_apps数组的样子:

_apps = 
[{
myId: 1,
title: 'title',
url: 'https://google.com/',
name: 'name',
description: 'desc',
state: 'Demo'
},
{
myId: 2, 
title: 'title',
url: 'https://google.com/',
name: 'name',
description: 'desc',
state: 'Live'
},
{
myId: 3, 
title: 'title',
url: 'https://google.com/',
name: 'name',
description: 'desc',
state: 'Live'
},
etc

我不确定尾随的空白是什么,因为据我所知,没有空间?

0 个答案:

没有答案