# Unexpected token while trying to inject NavController

**URL:** <https://forum.ionicframework.com/t/unexpected-token-while-trying-to-inject-navcontroller/45096>\
**Category:** ionic-v3\
**Created:** [February 29, 2016, 10:48pm UTC](https://forum.ionicframework.com/t/unexpected-token-while-trying-to-inject-navcontroller/45096 "2016-02-29T22:48:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ondonda](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ondonda/32/98088_2.png) [@ondonda](https://forum.ionicframework.com/u/ondonda)\
**Post date:** [February 29, 2016, 10:48pm UTC](https://forum.ionicframework.com/t/unexpected-token-while-trying-to-inject-navcontroller/45096/1 "2016-02-29T22:48:47Z")

</div>

`import {Page, NavController} from ‘ionic-framework/ionic’;  
import {Signup} from ‘…/signup/signup’;  
import {Pass} from ‘…/pass/pass’

@Page({  
templateUrl: ‘build/pages/login/login.html’  
})  
export class Login {  
constructor(nav: NavController){

}

goTosignup(){  
this.nav.push(Signup)  
}

}

Dependency injection is not working, i get this error  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/2/8/286d21ded1fde381bced56588f11135c081251d2.png)

---

<div class="post-metadata">

**Author:** ![wienzzz](https://avatars.discourse-cdn.com/v4/letter/w/5e9695/32.png) [@wienzzz](https://forum.ionicframework.com/u/wienzzz)\
**Post date:** [March 1, 2016, 2:03am UTC](https://forum.ionicframework.com/t/unexpected-token-while-trying-to-inject-navcontroller/45096/2 "2016-03-01T02:03:51Z")

</div>

This has been answered on other thread.

Check [This discussion here](https://forum.ionicframework.com/t/cannot-resolve-all-parameters-error/44969)

Basically, nav: NavController is used in TypeScript and you are only using Javascript.  
If you got that from example scattered on internet, probably those example are based on older build of Ionic2.

Cheers.

---

<div class="post-metadata">

**Author:** ![ondonda](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ondonda/32/98088_2.png) [@ondonda](https://forum.ionicframework.com/u/ondonda)\
**Post date:** [March 1, 2016, 9:16am UTC](https://forum.ionicframework.com/t/unexpected-token-while-trying-to-inject-navcontroller/45096/3 "2016-03-01T09:16:51Z")

</div>

solved my issue many thanks

---

<div class="post-metadata">

**Author:** ![itsmemyk](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itsmemyk/32/100236_2.png) [@itsmemyk](https://forum.ionicframework.com/u/itsmemyk)\
**Post date:** [March 2, 2016, 10:19am UTC](https://forum.ionicframework.com/t/unexpected-token-while-trying-to-inject-navcontroller/45096/4 "2016-03-02T10:19:11Z")

</div>

It was error due to changing the ionic 2 beta specification, earlier beta version using the typescript. Now its move on with babel JS you have to inject controls as following way

export class Login {  
static get parameters(){  
return [[NavController]];  
}  
constructor(nav){  
this.nav = nav;  
}  
}
