Skip to content

Instantly share code, notes, and snippets.

@Polyterative
Last active January 5, 2022 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Polyterative/5686184d2be254ae3c81df4d49321c98 to your computer and use it in GitHub Desktop.
Save Polyterative/5686184d2be254ae3c81df4d49321c98 to your computer and use it in GitHub Desktop.
common angular code
constructor(
private dialogRef: MatDialog,
public dataService: DataService,
public router: Router,
public route: ActivatedRoute
) {
this.route.params
.pipe(
map(x => x && x.id && parseInt(x.id) ? parseInt(x.id) : 0),
filter(x => x > 0),
take(1)
)
.subscribe(data => {
[...]
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment