Not specific to Angular, but this API has been replaced by the PerformanceNavigationTiming one, which also has a type
property, but which returns a string instead of a numerical code.
However I just noticed that Chrome won't expose this for iframes, which will always output "navigate"
.
The following snippet won't work in Chrome, please try this plnkr instead, in external view.
const entries = performance.getEntriesByType("navigation");
console.log( entries.map( nav => nav.type ) );
rel.onclick = e => location.reload();
<button type="button" id="rel">reload</button>
<a href="404">go to 404 (come back with your browser's back button)</a>