Search code examples
ember.jsember-clibing-maps

How to fix 'Microsoft' is not defined in Ember CLI Bing Map?


In an Ember CLI project, I managed to get the old 'bing-maps-element' working as a Component, but jshint and unit tests complain that "'Microsoft' is not defined". The Microsoft object is a global loaded by a 'veapicore' script (Virtual Earth API) after after the Ember Component tries to reference it, but it actually works OK at runtime.

I tried to install the 'ember-cli-bing-map' addon, thinking it might better integrate this global reference but I got a 'not a properly formatted package' error with it so had to remove it.

How can I resolve these problems?


Solution

  • You need to specify the global variables in .jshintrc file.

    Add Microsoft to the predef array in the file and your jshint errors should go away.