AngularJs embedding an MS Word doc using a $scope variable as the URL

后端 未结 2 1370
你的背包
你的背包 2021-01-22 01:34

Embedding a random MS Word word doc, which I found on the internet, works if I hard code the URL:


In JS controller:

var app = angular.module('app', ['ngSanitize']);

app.controller('Ctrl', function($scope, $sanitize, $sce) {
  var Url = 
    'http://yoururl.com.doc&embedded=true';

  $scope.urlHere= $sce.trustAsResourceUrl(Url);
});

提交回复
热议问题