Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get current url angular

import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
    template: 'The href is: {{href}}'
    /*
    Other component settings
    */
})
export class Component {
    public href: string = "";

    constructor(private router: Router) {}

    ngOnInit() {
        this.href = this.router.url;
        console.log(this.router.url);
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: ionic 4 how to iterate json object in view 
Javascript :: javascript if undefined 
Javascript :: twitter icon in next js 
Javascript :: text to Speech in javascript code 
Javascript :: preg_replace javascript 
Javascript :: discord js give role to all member 
Javascript :: terminate execution in jquery 
Javascript :: js loop array 
Javascript :: nodefetch of ES modules is not supported. 
Javascript :: how send to another page by router in vuejs 
Javascript :: count 1 to 5 javascript 
Javascript :: npm install the exact package version specified in package.json 
Javascript :: convert json to base64 javascript 
Javascript :: express send raw html 
Javascript :: ckeditor change value 
Javascript :: laravel 8 include javascript in blade 
Javascript :: blob to file javascript 
Javascript :: google maps js on map load 
Javascript :: import angular flex layout 
Javascript :: npm ERR! errno ECONNRESET 
Javascript :: jquery in react 
Javascript :: npm youtube-react 
Javascript :: get text in select jquery 
Javascript :: valid filename regex 
Javascript :: js html table extract data 
Javascript :: binary to ascii javascript 
Javascript :: c# get value from json object 
Javascript :: jquery post failure 
Javascript :: console regex 
Javascript :: javascript set div height 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =