Skip to content

Commit

Permalink
Merge pull request #6 from adwulfran/typescript
Browse files Browse the repository at this point in the history
remove uselesss line
  • Loading branch information
adwulfran authored Apr 14, 2021
2 parents 3f48470 + fff5d47 commit 39a359e
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 39a359e

Please sign in to comment.