Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- textarea {
- position: fixed;
- width: calc(100% - 235px);
- height: 100%;
- right: 0;
- top: 0;
- font-size: 18pt;
- padding-top: 20px;
- resize: none;
- border: none;
- padding: 20px 0px 20px 15px;
- }
- import { Component, OnInit, OnDestroy } from '@angular/core';
- import { DocumentService } from 'src/app/services/document.service';
- import { Subscription } from 'rxjs';
- import { Document } from 'src/app/models/document';
- import { startWith } from 'rxjs/operators';
- @Component({
- selector: 'app-document',
- templateUrl: './document.component.html',
- styleUrls: ['./document.component.scss']
- })
- export class DocumentComponent implements OnInit, OnDestroy {
- document: Document;
- private _docSub: Subscription;
- constructor(private documentService: DocumentService) { }
- ngOnInit() {
- this._docSub = this.documentService.currentDocument.pipe(
- startWith({ id: '', doc: 'Select an existing document or create a new one to get started'})
- ).subscribe(document => this.document = document);
- }
- ngOnDestroy() {
- this._docSub.unsubscribe();
- }
- editDoc() {
- this.documentService.editDocument(this.document);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement