Getting ready to load in the posts json file.

This commit is contained in:
Joachim Nielandt 2017-12-28 11:23:08 +01:00
parent 31921e1db9
commit e5df503d1a
16 changed files with 59 additions and 61 deletions

View File

@ -7,13 +7,17 @@ import { AppRoutingModule } from './app-routing.module';
import { HomeComponent } from './components/home/home.component'; import { HomeComponent } from './components/home/home.component';
import { ProjectsComponent } from './components/projects/projects.component'; import { ProjectsComponent } from './components/projects/projects.component';
import { ProjectComponent } from './components/project/project.component'; import { ProjectComponent } from './components/project/project.component';
import { PostsComponent } from './components/posts/posts.component';
import { PostComponent } from './components/post/post.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
HomeComponent, HomeComponent,
ProjectsComponent, ProjectsComponent,
ProjectComponent ProjectComponent,
PostsComponent,
PostComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,

View File

@ -0,0 +1,3 @@
<p>
post works!
</p>

View File

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ProjectComponent } from './project.component'; import { PostComponent } from './post.component';
describe('ProjectComponent', () => { describe('PostComponent', () => {
let component: ProjectComponent; let component: PostComponent;
let fixture: ComponentFixture<ProjectComponent>; let fixture: ComponentFixture<PostComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ ProjectComponent ] declarations: [ PostComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(ProjectComponent); fixture = TestBed.createComponent(PostComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-post',
templateUrl: './post.component.html',
styleUrls: ['./post.component.css']
})
export class PostComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -0,0 +1,3 @@
<p>
posts works!
</p>

View File

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ProjectsComponent } from './projects.component'; import { PostsComponent } from './posts.component';
describe('ProjectsComponent', () => { describe('PostsComponent', () => {
let component: ProjectsComponent; let component: PostsComponent;
let fixture: ComponentFixture<ProjectsComponent>; let fixture: ComponentFixture<PostsComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ ProjectsComponent ] declarations: [ PostsComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(ProjectsComponent); fixture = TestBed.createComponent(PostsComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-posts',
templateUrl: './posts.component.html',
styleUrls: ['./posts.component.css']
})
export class PostsComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -1,6 +0,0 @@
<h3>
<ng-content select=".title"></ng-content>
</h3>
<p>
<ng-content select=".content"></ng-content>
</p>

View File

@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'project',
templateUrl: './project.component.html',
styleUrls: ['./project.component.css']
})
export class ProjectComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -1,10 +0,0 @@
<p>These are the projects I have completed, am working on, got tired of... consider this to be a resume of work and hobbies. And also a little notebook for myself, in case I forget the specifics.</p>
<project>
<div class="title">
The title of the project :)
</div>
<div class="content">
this is inner content of the project
</div>
</project>

View File

@ -1,15 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-projects',
templateUrl: './projects.component.html',
styleUrls: ['./projects.component.css']
})
export class ProjectsComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@ -1,6 +1,7 @@
[ [
{ {
"title":"First post", "projects": [
"id":1 "test"
]
} }
] ]

View File

@ -0,0 +1,3 @@
<p>This is a project post</p>
<p>Typically, all these project posts will have a number of paragraphs.</p>
<p>Even images: <img src="assets/images/baby-duck.jpg"></img></p>