Tuesday 20 August 2019

How to Import External jquery files in angular 2 template?

I have an angular 2 app which has a template in the component as follows


app.component.ts


import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
templateUrl: 'templates/homepage.html',
directives: []
})
export class AppComponent {
}

I need to include external jquery files in the template homepage.html


I tried including the external script files in the homepage.html as follows doesn't seems to be working









boot.ts file looks like this


/// 
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from "./app.component";
bootstrap(AppComponent);

index.html





Angular 2 Boilerplate















Loading...




I tried loading the .js files in the index.html itself but that is not working. I am fairly new to angular 2.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...