html5

  • The iframe itself is going to be independent of the actual angular js app.
  • Stack Overflow works best with JavaScript enabled
  • It helps scrub html and ensure that what is getting loaded in the page is safe.
  • If the widget is dynamic based on what is happening in the angualr js app then you are at the mercy of when your data is loaded and available to provide a url for the iframe.
  • I would like to create a AngularJS app that can be embed on 3rd-party websites with a few lines of code.

I would like to create a AngularJS app that can be embed on 3rd-party websites with a few lines of code. Is it possible?

@twitmyreview: It’s possible to create embeddable AngularJS app based widget?

Yes, it is certainly possible. However, this means that the host page will have to know about angular js (unless you iframe the widget?) But otherwise, yes.

This will help you when using angular in a “3rd-Party” sense:

SCE is strict contextual escaping. It helps scrub html and ensure that what is getting loaded in the page is safe. But read the link for more details.

To start it I would start by looking here:

I know this is jquery, but you can use the examples to figure out how to bootstrap your widget and get it loaded.

Good luck!

lets say i have a large angularjs app, and i want to dedicate 1 page to a iframed widget, would this be to heavy? are there ways to efficiently load the widget? – Anthony Raimondo Nov 16 ’15 at 21:28

I would say it wouldn’t be too heavy. The iframe itself is going to be independent of the actual angular js app. The reason I have iframed the widget in the past is to create a clean separation from the app that it is hosted in so it wouldn’t affect the parent page. As for efficiently loading the widget, I can’t help you too much on that. If the widget is dynamic based on what is happening in the angualr js app then you are at the mercy of when your data is loaded and available to provide a url for the iframe. But I am no expert on iframe loading or performance for that matter – Simon Taylor Nov 17 ’15 at 22:44

html5

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.