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
<div>Shared publicly - {{ time | date:'medium' }}</div> |
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
//src/app/component/linktext/linktext.component.html | |
<div class="user-block"> | |
<h3>{{titletext}}</h3> | |
<div>Shared publicly - {{ time | date:'medium' }}</div> | |
</div> | |
<!-- /.user-block --> | |
<p> | |
({{linktext}}) | |
</p> |
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
//src/app/component/linktext/linktext.component.ts | |
import { Component, OnInit, Input } from '@angular/core'; | |
@Component({ | |
selector: 'app-linktext', | |
templateUrl: './linktext.component.html', | |
styleUrls: ['./linktext.component.css'] | |
}) | |
export class LinktextComponent implements OnInit { |
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
//src/app/app.component.ts | |
import { Component } from '@angular/core'; | |
import { Store } from '@ngrx/store' | |
import * as fromArticle from './redux/reducer' | |
import * as fromAction from './redux/actions/articles' | |
import { Article } from './redux/models/article'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', |
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
<button [disabled]='!addLinkForm.valid' type="submit" class="btn btn-primary">Submit Article</button> |
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
this.addLinkForm = this.fb.group({ | |
title: ['',[Validators.required,Validators.minLength(4)]], | |
article: ['',[Validators.required,Validators.minLength(4)]] | |
}) |
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 { FormBuilder,FormGroup,Validators, FormControl } from '@angular/forms'; |
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
//this was deprecated for brevity | |
<form [formGroup]='addLinkForm' (ngSubmit)="addLink()"> | |
<input type="text" class="form-control input-lg" id="title" placeholder="Write Your Title" formControlName='title'> | |
<input type="text" class="form-control input-lg" id="article" placeholder="Write Your Article Link" formControlName='article'> | |
</form> |
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
constructor(private fb: FormBuilder) { |
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
constructor(private fb: FormBuilder) { | |
this.addLinkForm = this.fb.group({ | |
title: ['',[Validators.required,Validators.minLength(4)]], | |
article: ['',[Validators.required,Validators.minLength(4)]] | |
}) | |
} |