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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>localStorage Test</title> | |
<script type="text/javascript" > | |
var count = 0; | |
var storageHandler = function () { | |
alert('storage event 1'); | |
}; |
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
export function initApp(http: HttpClient) { | |
return () => { | |
return http.get('https://api.github.com/users/sagar-ganatra') | |
.toPromise() | |
.then((resp) => { | |
console.log('Response 1 - ', resp); | |
}); | |
}; | |
} |
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
export function initApp() { | |
return () => { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
console.log('In initApp'); | |
resolve(); | |
}, 3000); | |
}); | |
}; | |
} |
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 { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule, APP_INITIALIZER } from '@angular/core'; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
BrowserModule |
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 React, { Component } from "react"; | |
import { observer } from "mobx-react"; | |
import Book from "../Book/"; | |
import "./ShoppingCart.css"; | |
@observer | |
class ShoppingCart extends Component { | |
render() { | |
return ( | |
<div className="shopping-cart-component"> |
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 () { | |
var TestView = Backbone.View.extend({ | |
el: '#container', | |
initialize: function () { | |
console.log('Inside Init'); | |
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
// create a flight component | |
var AboutMeBtn = flight.component(aboutMe); | |
// component definition | |
function aboutMe () { | |
// event listener for the click event | |
this.onAboutMeBtnClick = function () { | |
alert('About me'); | |
}; |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>{{ .Site.Title }}</title> | |
</head> | |
<body> | |
<nav> | |
{{ range .Site.Pages }} | |
{{ if eq .Type "pages" }} | |
<a href="{{ .Permalink }}">{{ .Title }}</a> |
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
exports.fn1 = function(){ | |
'use strict'; | |
console.log('Example 1 - use of let in blocks'); | |
let a = 10; | |
function test() { //new scope, TDZ | |
//console.log(a); //throws reference error |
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
var AppRouter = Backbone.Router.extend({ | |
routes: { | |
"": "index", | |
"welcome": "welcome" | |
}, | |
index: function() { | |
loginViewInstance.render(); | |
}, |
NewerOlder