I am developing a website using Angular 2 and need to incorporate a JavaScript file into a component. The goal is for this script to adjust the height of certain images to match the height of the browser window.
What is the best way to integrate this script into the component?
The solutions I have come across on Stack Overflow and other sources suggest importing the script like this:
import './home.component.js';
However, this does not meet my requirements. Ideally, I would like to include it in my home.component.ts
file as follows:
@Component({
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
jsUrls: ['./home.component.js']
})
or something similar...
Update 1: My project utilizes Angular CLI and TypeScript.
Update 2: You can access my project on GitHub: https://github.com/WatchFriends/Web