Skip to content

Property 'nav' does not exist on type 'AnyPage'. #5763

@MrBokeh

Description

@MrBokeh

Short description of the problem:

Error: Property 'nav' does not exist on type 'AnyPage'.

What behavior are you expecting?

How can I get rid of this error on all code editors and IDEs as well as on compile and ionic serve?

Steps to reproduce:

  1. just generate a page
  2. run ionic serve
  3. you will see the error of the nav but the nav is working
ERROR in [default] /.../app/pages/home-page/home-page.ts:15:9 
Property 'nav' does not exist on type 'HomePage'.

Problem with generated code:

constructor(@Inject(NavController) nav) {
    this.nav = nav;//this line throw errors on all Editors and IDEs and on Terminal
 }

Ionic Version: 2.0.0-beta.2

Browser & Operating System: iOS / Android / Chrome
Terminal

Run ionic info from terminal/cmd prompt:

Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.2
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: 1.8.5 
ios-sim version: 5.0.6 
OS: Mac OS X El Capitan
Node Version: v4.3.2
Xcode version: Xcode 7.2.1 Build version 7C1002 

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions