Office.context.document.getFilePropertiesAsync を呼び出し、返された URL を angular 変数に配置する Office Javascript API (Office.js) で記述された Office タスク ペイン アプリがあります。
$scope.getDocumentUrl = function () {
Office.context.document.getFilePropertiesAsync(function (asyncResult) {
$scope.url = asyncResult.value.url;
});
};
次に、これを呼び出すボタンがあります。これは最初は機能しますが、ボタンを2回押すと、コールバックに入らず、次のエラーが表示されます。
TypeError:匿名関数 ( https://localhost:44304/scripts/office/1.1/o15apptofilemappingtable.js ) の verifyAndExtractCall ( https://localhost:44304/scripts/office/1.1/o15apptofilemappingtable.js:11:54588 ) でオブジェクトが予期されます:11:83048 ) 匿名関数 ( https://localhost:44304/scripts/office/1.1/o15apptofilemappingtable.js:11:86071 ) で $scope.getDocumentUrl ( https://localhost:44304/AngularJs/controllers/sandpit .controller.js:130:6 ) $parseFunctionCall ( https://localhost:44304/AngularJs/bower_components/angular/angular.js:12403:7 ) でコールバック ( https://localhost:44304/AngularJs/bower_components/ ) で角度/角度.js:21566:17) Scope.prototype.$eval ( https://localhost:44304/AngularJs/bower_components/angular/angular.js:14466:9 ) で Scope.prototype.$apply ( https://localhost:44304/AngularJs/bower_components で) /angular/angular.js:14565:11 ) 匿名関数 ( https://localhost:44304/AngularJs/bower_components/angular/angular.js:21571:17 ) で jQuery.event.dispatch ( https://localhos
これは、同じエラーが発生する別の状況の単純化されたバージョンです。getFileAsync でも発生します。変更を表示するには $scope.$apply が必要です。他の方法で URL を取得できることは知っています。エラーの原因を知る必要があります。