Subscribing to Browser Title Changes Using Angular

Angular includes a Title service, which includes getTitle(): string and setTitle(newTitle: string). If you want to keep an in-page header matching the browser title tag, you’ll need something to enable that possibility. If you like the pattern of subscribing to changes (as you might be, if you’re using Angular), check... [Read More]
Tags: angular

Angular 2 Services Testing Template

Here’s a simple template for testing Angular 2 services. If the HttpModule portions are uncommented and used, it will make actual wire calls. To use mock calls instead, see Angular 2 MockBackend Service Testing Template Using TestBed instead. import { async, inject, TestBed } from '@angular/core/testing'; // import { HttpModule... [Read More]
Tags: angular, testing

Angular 2 MockBackend Service Testing Template Using TestBed

Below is a template for using TestBed and MockBackend for mocking Angular 2 HTTP calls. If you want to make actual wire calls, see Angular 2 Services Testing Template instead. import { async, inject, TestBed } from '@angular/core/testing'; import { BaseRequestOptions, Http, HttpModule, Response, ResponseOptions } from '@angular/http'; import {... [Read More]
Tags: angular, testing