This file contains hidden or 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
// ... other imports | |
import { AuthService } from './auth.service'; | |
import { MaterialModule } from '@angular/material'; | |
@NgModule({ | |
// ... other properties | |
imports: [ | |
// ... other imports | |
MaterialModule.forRoot(), | |
], |
This file contains hidden or 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 } from '@angular/core'; | |
import Auth0Lock from 'auth0-lock'; | |
import { tokenNotExpired } from 'angular2-jwt'; | |
// FIXME: replace these with your own Auth0 'Client ID' and 'Domain' | |
const AUTH0_CLIENT_ID = 'YOUR_AUTH0_CLIENT_ID'; | |
const AUTH0_DOMAIN = 'YOUR_AUTH0_DOMAIN'; | |
// this is the key to the JWT in the browser localStorage | |
const ID_TOKEN = 'id_token'; |
This file contains hidden or 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
# generates NavBarComponent files under src/app/nav-bar | |
ng g component nav-bar | |
# generates AuthService under src/app/auth.service.ts | |
ng g service auth |
This file contains hidden or 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
# Auth0 Lock and Angular 2 JWT runtime deps | |
npm install --save auth0-lock angular2-jwt @angular/material | |
# Types definitions for Auth0 Lock | |
npm install --save-dev @types/auth0-lock |
This file contains hidden or 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
# install Angular CLI globally | |
npm install -g @angular/cli | |
# create skeleton | |
ng new task-list && cd task-list | |
# serve the skeleton on our dev env | |
ng serve |
This file contains hidden or 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 countTo_100_000 = function() { | |
for (var i=0; i<=100000; i++) { | |
console.log(i); | |
} | |
}; | |
var logHelloWorld = function () { | |
console.log("Hello World"); | |
}; |
This file contains hidden or 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
div.main | |
background-color: #eee | |
padding: 21px | |
font-family: "Times New Roman", Times, serif | |
div.content | |
color: green |