Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I make a site with Angular 2 and will add a JavaScript file to the component. This script must render the height of some images equal to the height of the window of the browser.

How could I add this script to the component?

The solutions I found on the internet are this:

TypeScript
import './home.component.js';

But it's not what I need! I need this in my home.component.ts file:

TypeScript
@Component({
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.scss'],
    jsUrls: ['./home.component.js']
})

or something...

In my site I use Angular CLI and TypeScript. You could find my project on GitHub - WatchFriends/Web[^]



What I have tried:

See question:

TypeScript
import './home.component.js';
Posted
Updated 24-Dec-16 0:54am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900