What is the better way to add office 365 javascript api library to angular js project?

Issue

Officejs library can be used inside angular controller as following way by adding library reference https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js to index page

function sendRequest() {
   // Create a local variable that contains the mailbox.
   var mailbox = Office.context.mailbox;

   mailbox.makeEwsRequestAsync(getItemRequest(mailbox.item.itemId), callback);
}

function callback(asyncResult)  {
   var result = asyncResult.value;
   var context = asyncResult.context;

   // Process the returned response here.
}

is there any better way to handle these kind of libraries inside angular js project ?

Solution

Yeoman generater is there. it has option to create angular project
https://www.npmjs.com/package/generator-office

Answered By – InfoÁsith

Answer Checked By – Willingham (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.