Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get page link 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 :: react img 
Javascript :: jquery version how 
Javascript :: how to get the url of a page in javascript 
Javascript :: javascript to string big number 
Javascript :: jquery migrate 
Javascript :: google sheet app script 
Javascript :: : Cannot set the body fields of a Request with content-type "application/json". 
Javascript :: binary to int javascript 
Javascript :: how to convert milliseconds to time in javascript 
Javascript :: react native text span 
Javascript :: javascript append element to array 
Javascript :: javascript password regular expression 
Javascript :: confetti for javascript 
Javascript :: vuejs react on route chagne 
Javascript :: livewire set model with javascript 
Javascript :: list all files in s3 bucket 
Javascript :: internal/modules/cjs/loader.js:1122 
Javascript :: console log in vue 
Javascript :: install react router 
Javascript :: fetch in react 
Javascript :: how to convert string to lowercase in javascript 
Javascript :: npm mongoose encryption 
Javascript :: MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 
Javascript :: datatable giving default width to colums 
Javascript :: convert to array str js 
Javascript :: npm js-cookie 
Javascript :: get placeholder innertext 
Javascript :: javascrpt formatBytes 
Javascript :: string to array javascript 
Javascript :: check for alphabetic string in javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =