This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, ViewChild, ViewContainerRef } from '@angular/core'; | |
import { DynamicComponentService } from '../DynamicComponentService'; | |
@Component({ | |
selector: 'my-app', | |
template: `<div #container></div>` | |
}) | |
export class MyAppComponent { | |
@ViewChild('container', { read: ViewContainerRef }) container: ViewContainerRef; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, Component, NgModule, Compiler } from '@angular/core'; | |
// Import any other module that may required by your dynamic component | |
import { FormsModule } from '@angular/forms'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class DynamicComponentService { | |
constructor(private compiler:Compiler) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This scrips require schedule,gitpython | |
# pip3 install schedule | |
# pip3 install gitpython | |
import string | |
import random | |
import datetime | |
import schedule # this is for shedule | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function task(my_task){ | |
return new Promise((resolve,reject)=>{ | |
setTimeout(function(){ | |
if(my_task == 'find loki'){ | |
resolve(); | |
}else{ | |
reject(); | |
} | |
},2000); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import Person from './Person'; | |
let p = new Person(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person{ | |
//some Code here | |
} | |
export default Person; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let avenger = { tony:'tony',says:'Sometimes you gotta run before you can walk.'}; | |
let {tony,says} = avenger; | |
console.log(tony); | |
console.log(says); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let tony = 'tony'; | |
let says = 'Sometimes you gotta run before you can walk.'; | |
let avanger = {tony,says}; | |
console.log(avanger);//Object {tony: "tony", says: "Sometimes you gotta run before you can walk."} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//es5 | |
var html = '<div class="form-group">'+ | |
'<label class="sr-only" for="">label</label>'+ | |
'<input type="email" class="form-control" id="" placeholder="Input field">'+ | |
'</div>'; | |
console.log(html); | |
//es6 | |
'use strict'; | |
let html = `<div class="form-group"> | |
<label class="sr-only" for="">label</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//es5 | |
var avenger = "tony"; | |
var says = "Sometimes you gotta run before you can walk."; | |
console.log(avenger+" says "+says); | |
//es 6 | |
"use strict"; | |
let avenger = "tony"; | |
let says = "Sometimes you gotta run before you can walk."; | |
console.log(`${avenger} says ${says}`); |
NewerOlder