Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3280

Two models in component.js

$
0
0

Hi team,

 

I have declared two different model in component.js.

One is oDatamodel. I didn't name it.

 

And another one is a JSON model. its a named model.

 

The problem is, I am able to bind the unnamed model in all views.

 

But When I tried to get JSON model, I am getting model is undefined.

The model visibility is not there in other views except in the root view.

 

For example if I use,

 

var model = this.getView().getModel("sampleModel"); //named JSON model

 

in root view, I am getting the object.

 

But If I use the same in other controller, I am getting undefined error.

 

Is there any way that I could fix this?

 

Thanks,

Karthik R


Viewing all articles
Browse latest Browse all 3280

Trending Articles



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