1 import {Component, OnInit, AfterViewInit, ViewChild, Renderer2} from '@angular/core';
2 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
3 import {MarcSavedEvent} from '@eg/staff/share/marc-edit/editor.component';
6 templateUrl: 'marc-edit.component.html'
8 export class AuthorityMarcEditComponent implements AfterViewInit {
12 // Avoid setting authorityId during lookup because it can
13 // cause the marc editor to load prematurely.
17 private router: Router,
18 private route: ActivatedRoute,
19 private renderer: Renderer2) {
20 this.authorityId = +this.route.snapshot.paramMap.get('id');
24 if (!this.authorityId) {
25 this.renderer.selectRootElement('#auth-id-input').focus();
31 this.router.navigate([`/staff/cat/authority/edit/${this.loadId}`]);