ritz078 / ng-embed

An AngularJS filter/directive for embedding emojis, media, maps, tweets, code and services
http://riteshkr.com/ng-embed
MIT License
122 stars 35 forks source link

Cannot resolve module 'ng-embed' #28

Closed arifulhb closed 8 years ago

arifulhb commented 8 years ago

I've loaded the module via npm install --save ng-embed But when I wan to require

var ngEmbed         = require('ng-embed');

I get this error.


> ERROR in ./resources/assets/js/app.js
> Module not found: Error: Cannot resolve module 'ng-embed'

require() is working with other packages. Can't find out why its happening!

ritz078 commented 8 years ago

currently there is no UMD support for ng-embed so it won't work this way.

arifulhb commented 8 years ago

ic.. I managed to make it working with solid path. It can load pdf.. but my final goal is to fetch pdf from amazons3 and show there.. my amazon bucket is private but with proper auth, I can get the url, but the I frame not showing the file.

I used following code to make the url whitelisted to the iframe

    $sceDelegateProvider.resourceUrlWhitelist([
    // Allow same origin resource loads.
    'self',
    // Allow loading from our assets domain.  Notice the difference between * and **.
    'https://s3*.amazonaws.com/**'
]);

but still, the Iframe is just a white page.. Any idea whats going on or I am missing something?

BTW.. thanks for the nice project :)

ritz078 commented 8 years ago

may be due to cross domain policy. I will be rewriting this library in v4. Will make sure these are fixed . Maybe till then you can use embed.js by creating a directive.

arifulhb commented 8 years ago

Thanks again.. I'll try that.. cross domain policy issue was fixed by codes in previous comment.. it was like my application was forcing to download the content.. not to show inline.. solved the issue.. Nothing to do with your package. ng-embed is awesome :+1: