Last active
January 5, 2022 14:24
-
-
Save Polyterative/5686184d2be254ae3c81df4d49321c98 to your computer and use it in GitHub Desktop.
common angular code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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