在我的Ionic 3项目中,我似乎得到了很多误报:
这是正常的吗?
12:27:29] tslint:src/pages/tabs/tabs.ts,line:28属性'navParams'已声明但从未使用过.
L27: constructor(
L28: private navParams: NavParams,
L29: @Inject(forwardRef(() => AuthService ))
Run Code Online (Sandbox Code Playgroud)
[12:27:29] tslint:src/pages/tabs/tabs.ts,line:30属性'authService'已声明但从未使用过.
L29: @Inject(forwardRef(() => AuthService ))
L30: private authService:AuthService
L31: ) {
Run Code Online (Sandbox Code Playgroud)
然而,这是代码:
export class TabsPage {
...
mySelectedIndex: number;
loggedIn:boolean;
constructor(
private navParams: NavParams,
@Inject(forwardRef(() => AuthService ))
private authService:AuthService
) {
console.log('TabsPage constructor: navParams.data: ', navParams.data);
this.loggedIn = authService.authenticated(RootPage.LAUNCHPAD.toString());
this.mySelectedIndex = navParams.data.tabIndex || 0;
console.log('Tabs pages: selectedIndex: ' + this.mySelectedIndex);
console.log('Tabs pages: loggedIn: ' + this.loggedIn);
}
isLoggedIn():boolean {
return this.loggedIn;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4506 次 |
| 最近记录: |