Embedding a random MS Word word doc, which I found on the internet, works if I hard code the URL:
Here you need to import the angularjs predefined services:
$sanitize, $sce inject these in your controller and you can replace or redesign the url, beause of if you use directly it will not render that url, because it is one of the security policy to rendering the unwated thing on webpage,
In HTML:
<iframe ng-src="{{urlHere}}"></iframe>
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);
});
You should use $sce.trustAsResourceUrl
var cvUrl =
'http://docs.google.com/gview?url=https://d9db56472fd41226d193-1e5e0d4b7948acaf6080b0dce0b35ed5.ssl.cf1.rackcdn.com/spectools/docs/wd-spectools-word-sample-04.doc&embedded=true';
$scope.cvUrlTrusted = $sce.trustAsResourceUrl(cvUrl);
and HTML:
<iframe ng-src="{{cvUrlTrusted}}"></iframe>
Demo Fiddle
<iframe src="{{cvUrl}}&embedded=true"></iframe> <!-- wrong syntax -->
or:
<iframe ng-src="{{cvUrlTrusted + '&embedded=true'}}"></iframe>
doesn't work too because of policy, so you need pass through $sce
full URL