Develop Office Add-in with Ember

It is possible to develop Office Addin with Ember, accord to

So far, there is not a working sample developed with Ember. I tried it myself, and stuck at the stage - boot the ember application inside Office.initialize.

In Angular sample,,

There is some piece of code,

import { platformBrowserDynamic } from ‘@angular/platform-browser-dynamic’; import { AppModule } from ‘./app.module’;

Office.initialize = function () { const platform = platformBrowserDynamic(); platform.bootstrapModule(AppModule); };

I wonder how it can be done in Ember?

Many thanks,

Same question here. I run into a different issue though. I just added the path to office.js in the index.html. When loading it there is some mess up within jQuery going on giving me this message: TypeError: (0 , _emberMetal.get)(…).replaceState is not a function

Advice anyone?

The first thing I would suggest is switching your Ember app’s location type to hash or none. You do that in config/environment.js, and the docs about the different types are here.

As for controlling the app boot, you can do a couple different things. One simple thing to try is to dynamically build and append a script tag for your app.js, doing that work inside Office.initialize.

Another way would involve setting autoboot to false on your Ember app and booting it manually from Office.initialize.

Thanks for the reply. I noticed that the error I got was caused by the Outlook Add-in scripts nulling the browser history functions. So when Ember tries to manipulate the history, it can’t access the functions anymore. I’m going to try your advice setting the location type to none.

When using location: 'none' nothing in Ember’s router stack should be touching the browser’s history functions.