cancel
Showing results for 
Search instead for 
Did you mean: 

Demo.controller.js:24 Uncaught TypeError: Cannot read property 'getResourceBundle' of undefined

0 Kudos

I have included the Resource Model in manifest.json and I am referring to that resource in Controller. I am facing Demo.controller.js:24 Uncaught TypeError: Cannot read property 'getResourceBundle' of undefined.

manifest.json...

controller

logs...

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor
0 Kudos

Your model i8n model is not instantiated, please check where you are creating the i18n model(Component or manifest.json) and see the code is written correctly there.

BR,

Mahesh

Answers (1)

Answers (1)

harsharya1011
Newcomer
0 Kudos

Hi,

I also get the same error in my code and when I added these line of code in my manifest.json file.It worked properly. So, I advice try to add these below lines of code while defining model in your manifest.json. 

 
"models": {
        "i18n": {
          "type": "sap.ui.model.resource.ResourceModel",
          "settings": {
            "bundleName": "i18n/i18n.properties"
          },
          "uri": "sap.ui.demo.i18n.i18n.properties",
          "preload": true
        }
 
Thanks & Regards
Harsh Arya