1

I have a javascript service CoreAdapterService. Within that code there are a lot of literal references to CoreAdapterService namespace which I want to replace with a var.

I have tried declaring a var at the top of the service and use it in the service as shown in code sample but no luck. Any help welcome

enter image description here

0

1 Answer 1

2

I am sorry it seems like my previous answer was incorrect, you are currently trying to get a var inside your object. The function you are executing has another scope so it is unable to reach the variable. A possible solution would be to define your variable above your adapter. Then the following code should work.

Try the following:

var definition = this[adapterNameSpace].service[service];

This way you are gettings this.CoreAdapterService.services[service];

Sign up to request clarification or add additional context in comments.

1 Comment

it should be this[this.adapterNameSpace].service[service]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.