Advertisement
selvalives

Untitled

Aug 8th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. textarea {
  2. position: fixed;
  3. width: calc(100% - 235px);
  4. height: 100%;
  5. right: 0;
  6. top: 0;
  7. font-size: 18pt;
  8. padding-top: 20px;
  9. resize: none;
  10. border: none;
  11. padding: 20px 0px 20px 15px;
  12. }
  13.  
  14. import { Component, OnInit, OnDestroy } from '@angular/core';
  15. import { DocumentService } from 'src/app/services/document.service';
  16. import { Subscription } from 'rxjs';
  17. import { Document } from 'src/app/models/document';
  18. import { startWith } from 'rxjs/operators';
  19.  
  20. @Component({
  21. selector: 'app-document',
  22. templateUrl: './document.component.html',
  23. styleUrls: ['./document.component.scss']
  24. })
  25. export class DocumentComponent implements OnInit, OnDestroy {
  26. document: Document;
  27. private _docSub: Subscription;
  28. constructor(private documentService: DocumentService) { }
  29.  
  30. ngOnInit() {
  31. this._docSub = this.documentService.currentDocument.pipe(
  32. startWith({ id: '', doc: 'Select an existing document or create a new one to get started'})
  33. ).subscribe(document => this.document = document);
  34. }
  35.  
  36. ngOnDestroy() {
  37. this._docSub.unsubscribe();
  38. }
  39.  
  40. editDoc() {
  41. this.documentService.editDocument(this.document);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement