In jQuery we could perform an ajax request and to an external page that 
returns HTML, and simply assign the .html() of a div on our current page to 
the result of the call, and the html from the external page would be loaded.

Another jQuery option was to use .load(ur;) on a div, and the div would 
have the html of the url provided loaded into it.

How do we perform a similar task in Angular 2?  I am trying to do the below 
call, where url is url of an HTML page

*this._http.get(url)*
*            .map(res => res.text())*
*            .subscribe(*
*            data => {*
*                this.temp = this.sanitizer.bypassSecurityTrustHtml(``);*
*                this.temp = data;                *
*            }*


Then, I perform binding as follows:
*<div [innerHTML]="temp"> * 


The call works, but, and I see content from the url I performed a get on 
inside of my div on the local page, however, the CSS is off and some of the 
JS scripts don't work.  Any thoughts.  Note, the url I'm calling out is a 
page in one of my apps, so I trust the HTML that will be returned.


Please let me know if you have any insight or suggestions.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to