Skip to content

Instantly share code, notes, and snippets.

@Polyterative
Last active January 5, 2022 14:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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