Looking at NavParams
I can’t help but wonder why it exists. I’m fairly new to Ionic 2, but from what I can tell when you call navController.push(MyPage, { foo: 'bar' });
, the NavParams
that gets sent through the constructor for MyPage
will have a single key "foo"
which I have to look up with the get()
method. What I don’t understand is how this is better than just passing the original object through? NavParams
even has a member data
which already seems to be that object I passed through. Why should I do navParams.get('foo')
instead of navParams.data.foo
?
To be clear, I’m asking out of curiosity. I assume the Ionic team has a good reason for this, I’d just like to learn more