Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

No provider for NavParams! (MyApp -> NavParams)

$
0
0

@big_bill91 wrote:

Hi everyone,

My objective is to get params from another page to the root page using NavParams with pop function.

app.ts :

@App({
    templateUrl: 'build/app.html',
    providers: [MyService]
})

export class MyApp implements OnInit {
   rootPage:any = AnotherPage;
    constructor(public app: IonicApp,public navparams : NavParams , public platform: Platform, private _MyService: MenuService) {
        this.navparams =this.navparams.get('param');
        this._MyService = _MyService;
    }
     ngOnInit() {

    }
}

AnotherPage :

@Page({
    templateUrl:"build/pages/Anotherpage/Anotherpage.html",
    providers: [MyService],
    directives: [IONIC_DIRECTIVES]
})

export class AnotherPage implements OnInit{
      constructor(public nav :NavController,public navparams: NavParams, private _MyService:MyService) {
        this.nav = nav;
        this._MyService = _MyService;
    }
 ngOnInit() {
 }
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>