Skip to content

Instantly share code, notes, and snippets.

@IAfanasov
Created October 22, 2020 06:19
Show Gist options
  • Save IAfanasov/62e2705b291b5f82f2a9cebb8ac300aa to your computer and use it in GitHub Desktop.
Save IAfanasov/62e2705b291b5f82f2a9cebb8ac300aa to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-dummy-component',
templateUrl: './dummy-component.component.html',
})
export class DummyComponent implements OnInit {
constructor(public route: ActivatedRoute) {
}
ngOnInit(): void {
if (this.route.snapshot.queryParams[QueryParamNames.id]) {
// load the item and show the edit form
} else {
// load the creation form
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment