A curated list of AngularJS modules and tools
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 { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
@NgModule({ | |
imports: [], | |
providers: [ | |
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true } | |
] | |
}) | |
export class AppModule {} |
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 { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
@NgModule({ | |
imports: [], | |
providers: [ | |
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true } | |
] | |
}) | |
export class AppModule {} |
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
interface HttpInterceptor { | |
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>; | |
} |
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 } from '@angular/core'; | |
import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpEventType } from '@angular/common/http'; | |
import { Observable } from 'rxjs/Observable'; | |
export class AuthInterceptor implements HttpInterceptor { | |
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<HttpEventType.Response>> { | |
const authReq = req.clone({ | |
setHeaders: { Authorization: `Bearer authtest` } | |
}); |
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>My First Angular 2 app</title> | |
</head> | |
<body> | |
<my-app>Loading...</my-app> | |
<!-- dependencies --> | |
<script src="https://code.angularjs.org/tools/traceur-runtime.js"></script> |
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'; | |
angular.module('myApp.services', []) | |
.value('version', '0.1') | |
.constant('API_KEY', 't5vzuyfb49c2sd56sjz4bc2p') | |
.factory('$rtmFactory', function($http, API_KEY){ | |
var countries = [ | |
{name:'USA', code:'us'}, | |
{name:'UK', code:'uk'}, | |
{name:'France', code:'fr'} |
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
#!/bin/sh | |
# homebrew-cask | |
brew tap phinze/homebrew-cask | |
brew install brew-cask | |
# browsers | |
brew cask install google-chrome | |
brew cask install opera-next |
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
app.get('loggedin', function(req, res) { | |
//body... | |
}); |
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
/*= @group State | |
---------------------------------------------------------------------- */ | |
.is-hidden { | |
display: none; | |
} | |
.is-hidden--floated { | |
position: absolute; | |
visibility: hidden; | |
@include opacity(0); |