angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

How to import custom js and load in OnInit()

Open sudhakarsukumar opened this issue 9 years ago • 3 comments

I need to send values to function print() in hello.js and work on it

import { Component, OnInit } from '@angular/core'; import * as hello from "./hello.js";

@Component({ selector: 'hello', templateUrl: 'hello.component.html' })

export class ChartsComponent implements OnInit {

ngOnInit() { $.print("hello"); } }

error is Property 'print' does not exist on type 'JQueryStatic'.)

sudhakarsukumar avatar Mar 06 '17 13:03 sudhakarsukumar

hello.print("hello"); most likely.

mattdistefano avatar Mar 06 '17 15:03 mattdistefano

Closing as probably answered. This isn't a CLI question though, Stack Overflow is a better place to ask.

filipesilva avatar Mar 17 '17 19:03 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.