0
자바 스크립트 파일과 CSS 4 파일을 사용하고 있습니다. 외부 CSS 및 자바 스크립트 파일을 각도 4로 가져 오기
나는이 같은angular-cli.json
파일에 가져 오기 시도 :
"styles": [
"../../../bootstrap-combobox/js/bootstrap-combobox.min.css",
"./styles.scss"
],
"scripts": [
"../../../bootstrap-combobox/js/bootstrap-combobox.min.js"
],
을하지만 작동하지 않습니다. 파일의 경로가 올바른지 확인했습니다. 또한
내가 함수에 HTML 요소를 할당 할 jQuery를 사용할 필요가,이 작품을 만들기 위해, 그래서 그것을 이런 식으로했다 : 나는 그것을 적용 할 것인지, 여기import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import * as jQuery from '../../../node_modules/jquery'
@Component({
selector: 'app-billgenerator',
templateUrl: './billgenerator.component.html'
})
export class BillgeneratorComponent implements OnInit {
constructor() { }
ngOnInit() {}
ngAfterViewInit() {
jQuery(document).ready(function() {
jQuery(".chosen").combobox();
});
}
}
는 HTML 요소입니다 에 :
<select class="chosen">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
내가 뭘 잘못하고 있니? 최근 Angular를 배우기 시작 했으므로 그것에 대해 많이 알지 못합니다.