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
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
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
version: 2.1 | |
aliases: | |
restore_cache: &restore_cache | |
restore_cache: | |
name: Restore Npm Package Cache | |
keys: | |
- v1-dependencies-{{ checksum "package-lock.json" }} | |
save_cache: &save_cache | |
save_cache: |
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
<router-outlet></router-outlet> |
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 { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { LoginComponent } from './pages/login/login.component'; | |
import { AccountBalanceComponent } from './pages/account-balance/account-balance.component'; | |
import { ProfileComponent } from './pages/profile/profile.component'; | |
import { AuthenticatedGuard } from './services/authenticated.guard'; | |
const routes: Routes = [ | |
{ | |
path: '', |
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 { TodoService } from "services/todo.service" | |
describe("TodoService", () => { | |
let TodoServiceInstance | |
beforeEach(() => { | |
const $http = { | |
get: jest.fn() | |
} | |
const BASE_URL = "http://localhost:5000/todos" | |
TodoServiceInstance = new TodoService($http, BASE_URL) |
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
{ | |
"todos": [ | |
{ | |
"name": "Learn Programming using component based approach", | |
"completed": true | |
}, | |
{ | |
"name": "Learn Machine Learning", | |
"completed": false | |
}, |
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
- request: | |
url: ^/api/todos | |
response: | |
headers: | |
content-type: application/json | |
status: 200 | |
file: todos_get.json |
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
{ | |
"name": "angularjs-tdd-jest", | |
"version": "0.1.0", | |
"scripts": { | |
"server": "webpack-dev-server", | |
"start": "npm-run-all -p stubs server", | |
"stubs": "stubby -w -d stubs/fakeserver.yml -s 5000", | |
"tdd": "cross-env NODE_PATH=./src jest --watch --verbose", | |
"test": "cross-env NODE_PATH=./src jest --coverage --verbose" | |
}, |
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
class TodoListController { | |
addTodo(todo){ | |
this.todosList.push(todo) | |
} | |
toggleCheckTodo(index){ | |
this.todosList[index].completed = !this.todosList[index].completed | |
} | |
deleteTodo(index){ | |
this.todosList.splice(index, 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
import '@uirouter/angularjs' | |
export function routes($stateProvider, $locationProvider) { | |
$locationProvider.html5Mode({ | |
enabled: true, | |
requireBase: false | |
}) | |
$stateProvider | |
.state("home", { | |
url: "/", |
NewerOlder