### File

`src/link/link.directive.ts`

### Description

A convinence directive for applying styling to a link.

See demo

Example:

     * <a href="#" ibmLink>A link</a>
     *

See the vanilla carbon docs for more detail.

../../iframe.html?id=link--basic

### Example

### Metadata

Selector | `[ibmLink]`

### Index

###### Properties

- Private _disabled

###### Inputs

- disabled

###### HostBindings

- attr.tabindex
- class.bx--link

###### Accessors

- disabled

### Inputs

`disabled` | Set to true to disable link. Type : `boolean`
Defined in src/link/link.directive.ts:44

### HostBindings

attr.tabindex
`attr.tabindex: ```
Defined in src/link/link.directive.ts:36
Automatically set to `-1` when link is disabled.

class.bx--link
`class.bx--link: ```
Default value : `true`
Defined in src/link/link.directive.ts:31

### Properties

Private _disabled
`_disabled: ```
Defined in src/link/link.directive.ts:53

### Accessors

disabled
get `disabled()`
Defined in src/link/link.directive.ts:49
set `disabled(disabled: boolean)`
Defined in src/link/link.directive.ts:44

Set to true to disable link.

Parameters :

Name | Type | Optional
disabled | `boolean` | No

Returns : `void`

    import {
    	Directive,
    	HostBinding,
    	Input
    } from "@angular/core";

    /**
     * A convinence directive for applying styling to a link.
     *
     * [See demo](../../?path=/story/link--basic)
     *
     * Example:
     *
     * ```hmtl
     * <a href="#" ibmLink>A link</a>
     * ```
     *
     * See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/link/code) for more detail.
     *
     * <example-url>../../iframe.html?id=link--basic</example-url>
     *
     * @export
     * @class Link
     */
    @Directive({
    	selector: "[ibmLink]"
    })

    export class Link {
    	@HostBinding("class.bx--link") baseClass = true;

    	/**
    	 * Automatically set to `-1` when link is disabled.
    	 */
    	@HostBinding("attr.tabindex") tabindex;

    	/**
    	 * Set to true to disable link.
    	 */
    	@Input()
    	@HostBinding("attr.aria-disabled")
    	@HostBinding("class.bx--link--disabled")
    	set disabled(disabled: boolean) {
    		this._disabled = disabled;
    		this.tabindex = this.disabled ? -1 : null;
    	}

    	get disabled(): boolean {
    		return this._disabled;
    	}

    	private _disabled;
    }

# result-matching ""

# No results matching ""