Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| // auth-guard.ts | |
| import { Injectable } from '@angular/core'; | |
| import { | |
| CanActivate, | |
| Router, | |
| ActivatedRouteSnapshot, | |
| RouterStateSnapshot | |
| } from '@angular/router'; | |
| import { AuthService } from './services/auth/auth.service'; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| let user = { | |
| name: "sam", totalReplies: 17, isBlocked: false | |
| }; | |
| user[Symbol.iterator] = function * (){ | |
| let properties = Object.keys(this); | |
| let count = 0; | |
| let isDone = false; |
| class Advertisement { | |
| constructor(title, link){ | |
| this.title = title; | |
| this.link = link; | |
| } | |
| _buildContent(){ | |
| return `<h1>${this.title}</h1> | |
| <a href="${this.link}">${this._linkText()}</a>`; |
| class TagManager { | |
| constructor(topicId) { | |
| this.topicId = topicId; | |
| } | |
| addTag(tagName) { | |
| API.createTag(tagName, this.topicId); | |
| } | |
| removeTag(tagName) { |
| let recentPosts = new Map(); | |
| recentPosts.set( "Sam", "ES2015" ); | |
| recentPosts.set( "Tyler", "CoffeeScript" ); | |
| recentPosts.set( "Brook", "TypeScript" ); | |
| for( let [user, postTitle] of recentPosts ){ | |
| console.log(`${user} = ${postTitle}`); | |
| } |
| const barker = (state) => ({ | |
| bark: () => console.log('Woof, I am ' + state.name) | |
| }) | |
| const driver = (state) => ({ | |
| drive: () => state.position = state.position + state.speed | |
| }) | |
| const murderRobotDog = (name) => { | |
| let state = { | |
| name, |
| for (var i = 0, len = a.length; i < len; i++) { | |
| // Do something with a[i] | |
| } |
| var allowed = (age > 18) ? "yes" : "no"; |
| $('itemwanttochange').toggleClass(function(){ | |
| return booleanVal ? "IS_TRUE" : "IS_FALSE"; | |
| }); |