Having trouble getting help?
Contact Support
Contact Support
Add link to a button in Angular Button component
27 Apr 20241 minute to read
Link can be added to the Button by adding e-link
using cssClass
property and <a>
tag with href
attribute should be added inside the button element.
The following example illustrates how to add link to a Button.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
import { enableRipple } from '@syncfusion/ej2-base'
import { Component } from '@angular/core';
@Component({
imports: [
ButtonModule
],
standalone: true,
selector: 'app-root',
template: `<div class="e-section-control">
<!-- To render Button. -->
<button ejs-button cssClass='e-link'><a href="https://www.google.com/" target='_blank'>Go to google</a></button>
</div>`
})
export class AppComponent { }
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));