将 office 365 javascript api 库添加到 angular js 项目的更好方法是什么?

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

Officejs 库可以在 angular 控制器中使用,方法如下:将库引用 https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js 添加到索引页面

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.
}

有没有更好的方法来处理 angular js 项目中的这类库?

Yeoman 生成器就在那里。它可以选择创建 angular 项目 https://www.npmjs.com/package/generator-office