View app.js
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 './App.css'; | |
import {Header} from "./components/Header"; | |
import {Main} from "./components/Main"; | |
import {Footer} from "./components/Footer"; | |
function App() { | |
const appTitle = 'TodosApp'; | |
const todos = [ | |
{title: 'Learn React', completed: false}, |
View custom-preload.ts
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 {PreloadingStrategy, Route} from "@angular/router"; | |
import {Observable, of} from "rxjs"; | |
import {Injectable} from "@angular/core"; | |
/** | |
* Starting point for a CustomPreloading class from our live session! | |
* You can (and should) customize it further more to meet your needs | |
*/ | |
@Injectable({providedIn: 'root'}) |
View app.component.ts
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, ViewEncapsulation } from '@angular/core'; | |
import { NgxBlocklyConfig, NgxBlocklyGenerator } from 'ngx-blockly'; | |
@Component({ | |
selector: 'app-root', | |
template: ` | |
<h1>Demo</h1> | |
<ngx-blockly [config]="config" (javascriptCode)="onCode($event)"></ngx-blockly> | |
`, |
View app.module.ts
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 { NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgxBlocklyModule } from 'ngx-blockly'; | |
import "blockly/blocks"; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
declarations: [ | |
AppComponent |
View renderer-template.js
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 Reconciler from "react-reconciler"; | |
const hostConfig = { | |
supportsMutation: true, | |
supportsPersistence: false, | |
noTimeout: -1, | |
isPrimaryRenderer: true, | |
supportsHydration: false, | |
createInstance(type, props, rootContainer, hostContext, internalHandle) { |
View js_morning_2.js
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
/******************* | |
warm up | |
*******************/ | |
function* generateAlphaBet() { | |
let i = "a".charCodeAt(0); | |
let end = "z".charCodeAt(0) + 1; | |
while(i < end) { | |
yield String.fromCharCode(i); |
View main.ts
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
async function bootstrap() { | |
const config = await fetch('http://localhost:3000/config').then( res => res.json() ); | |
// You can provide static providers to the created platform | |
const browserPlatform = platformBrowserDynamic([ | |
{ provide: ConsoleLogger } | |
]); | |
// After bootstrapping your module you can use thק appModuleRef to configure | |
// The module injector, and get access to this module components |
View AppComponent.js
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 VideoPlayer from "./VideoPlayer"; | |
const App = () => ( | |
<div> | |
<h1>Declarative Usage</h1> | |
{/* create context for a VideoPlayer */} | |
<VideoPlayer> | |
<VideoPlayer.Player src={"sample.mp4"}/> |
View psudo_code.ts
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
// Concept | |
@Directive({ | |
selector: 'introTip' | |
}) | |
class IntroTipDirective implements Oninit{ | |
@Input('introTip') key: string; | |
constructor(private hostElement: ElementRef, | |
private interService; |
View tiny-observable.js
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
// ******************************* | |
// Just a wrapper around callbacks, | |
// So we can use the same API - and state of mind | |
// ******************************* | |
// helper to create observable | |
function createObservable(subscribe) { | |
return { | |
subscribe, |
NewerOlder