仕事
サーバー講習会
昨日の続き。jsonが表示できていなかった理由がわかった。
src/app/app.module.ts
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { RouterModule } from "@angular/router"; import { AppComponent } from './app.component'; import { PostsComponent } from './posts/posts.component'; import { PostsService } from "./posts.service"; import {FormsModule} from "@angular/forms"; import {HttpModule} from "@angular/http"; // Define the routes const ROUTES = [ { path: '', redirectTo: 'posts', pathMatch: 'full' }, { path: 'posts', component: PostsComponent } ]; @NgModule({ declarations: [ AppComponent, PostsComponent ], imports: [ BrowserModule, FormsModule, HttpModule, RouterModule.forRoot(ROUTES) // Add routes to the app ], providers: [PostsService], bootstrap: [AppComponent] }) export class AppModule { }
こんな感じ。
スプラトゥーン
イイダさんかわいい。