@Component({
selector: 'app-selectb',
template: `<div [innerHTML]="sanitizer.bypassSecurityTrustHtml(this.url)">
</div>`
})
export class SelectComponent implements OnInit {
@Input() abi:string;
url: string;
constructor(public sanitizer:DomSanitizer) {
}
ngOnInit() {
var myId;
var myLanguage;
myId = $("div[name=check]").attr('data-abi');
myLanguage = $("div[name=check]").attr('data-lang');
if(myId==undefined || myId=="" || !(require('./banche/'+myId+'/it/file.html'))){
myId='default';
}
this.url = require('./banche/'+myId+'/'+myLanguage+'/file.html');
require('style-loader!./banche/'+myId+'/style.css');
}
}
我想知道html文件是否存在于路径中,变量myId必须变为&#34;默认&#34; (有一个默认路径,默认名称)。谢谢:))