Skip to content

Commit

Permalink
remove uselesss line
Browse files Browse the repository at this point in the history
  • Loading branch information
adwulfran committed Apr 14, 2021
1 parent 3b1497a commit fff5d47
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions app/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ declare module globalThis {
}

export class Component {

constructor() {

}
render(el:any) {
if (globalThis.routes.findIndex((x:any) => x.path === el['path']) !== -1) {

render(el: any) {
if (globalThis.routes.findIndex((x: any) => x.path === el['path']) !== -1) {
var root = document.getElementById('root');
root.innerHTML = `<` + el['path'] + `>` + el['template'] + `</` + el['path'] + `>`;
var style = document.createElement('style');
Expand All @@ -23,13 +23,8 @@ export class Component {
nested_comp.innerHTML = el['template'];
nested_comp.appendChild(style);
var script = document.createElement('script');
if (el['path'] === 'home-component') {
script.src = "../dist/" + el['path'] + ".ts"
}
else {
script.src = "../dist/" + el['path'] + ".js"
}
nested_comp.appendChild(script)
script.src = "../dist/" + el['path'] + ".js"
nested_comp.appendChild(script);
}
}

Expand Down

0 comments on commit fff5d47

Please sign in to comment.