Copying the answer from Chris:
Got it working:
import {AfterViewInit} from 'angular2/core';
export class HomeCmp implements AfterViewInit {
ngAfterViewInit() {
//Copy in all the js code from the script.js. Typescript will complain but it works just fine
}
More Related Contents:
- Angular HTTP GET with TypeScript error http.get(…).map is not a function in [null]
- How to detect a route change in Angular?
- How can I use “*ngIf else”?
- Error when trying to inject a service into an angular component “EXCEPTION: Can’t resolve all parameters for component”, why?
- Angular2 change detection: ngOnChanges not firing for nested object
- How to go back last page
- Angular 2 – innerHTML styling
- Difference between [ngClass] vs [class] binding
- Angular Subscribe within Subscribe
- How to store token in Local or Session Storage in Angular 2?
- How to use [(ngModel)] on div’s contenteditable in angular2?
- How can I conditionally disable the routerLink attribute?
- Cannot read property ‘push’ of undefined(…) in angular2
- two way binding with safe navigation operator
- When to use square brackets [ ] in directives @Inputs and when not?
- Angular2 – Interaction between components using a service
- Angular 2 Testing – Async function call – when to use
- Uncaught (in promise): Error: StaticInjectorError(AppModule)[options]
- VSCode debugger blank page and loading on launch with VS Code 1.76.1 and Chrome 111
- Update to Angular v6 – Module not found: Error: Can’t resolve ‘fs’
- How to translate mat-paginator in Angular 4?
- Docker container doesn’t reload Angular app
- Angular: selected on option of select doesn’t work as excepted while using along with ngModel
- NX MFE angular module federation not able to access remote micro front end
- How to return observable from subscribe
- Limit input field to two decimal places – Angular 5
- How to create and download text/Json File with dynamic content using angular 2+
- Angular4 Load external html page in a div
- angular2: http post not executing
- How to use angular2 built-in date pipe in services and directives script files [duplicate]