我创建了一个角度应用程序,并希望使用JS API库.我想在Office 365 Outlook中使用此应用程序.但是,我收到以下错误:
Uncaught TypeError: window.external.GetContext is not a function
OSF.InitializationHelper.getAppContext @ o15apptofilemappingtable.js:11
Run Code Online (Sandbox Code Playgroud)
我在浏览器上运行index.html,最终我将从Office 365 outlook中运行它.以下是代码:
index.html的:
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Office 365 APIs sample</title>
<base href="/">
...
...
<!-- JavaScript Office API -->
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>
<!-- App code. -->
<script src="scripts/app.js"></script>
<script src="controllers/homeController.js"></script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
app.js:
(function () {
console.log("STARTING...");
var init = function (reason) {
$(document).ready(function () {
console.log("ready");
});
};
try {
Office.initialize = init; …Run Code Online (Sandbox Code Playgroud) 我使用 durandal 框架和 Office365 JavaScript API(office.js) 创建了 Outlook365 的 SPA 邮件插件。在我的应用程序中的某个地方,我想使用
window.history.replaceState函数,但该函数在 office.js 中显式设置为 null,从而导致错误。
//following lines are presents in Office.js
window.history.replaceState = null;
window.history.pushState = null;
Run Code Online (Sandbox Code Playgroud) 在哪里可以找到office.js的稳定TypeScript定义?我正在开发一个O365应用程序作为MailApp,在我的项目中我使用的是打字稿.
我很喜欢https://www.napacloudapp.com/External/O365/Office.Common.d.ts 但是没有找到任何文档和路线图来进一步更新.