Question: I have this link-to that will be enabled/disabled depending on the property "linkDisabled". Initially the property will be true and this link-to will be disabled.

```
{{#link-to "databinding2" disabled=linkDisabled}}Databinding2{{/link-to}}

```

Whenever I click on this button I want to toggle the link between disable and enable without reloading any component.

```
 <button {{action 'changeLinkState'}} >Click here</button>

```

This is how I want to handle it in the controller.

```
App.ApplicationController=Ember.Controller.extend({
linkDisabled:true,
actions:{
    changeLinkState:function(){
        if(this.linkDisabled==true)
        {
            this.linkDisabled=false;
        }
        else
        {
            this.linkDisabled=true;
        }
    }
}

```

});

Is it possible to do so without making asynchronous call?

As the property linkDisabled is being used in {{#link-to}}, so, it's throwing error when I try to modify it true or false.

```
Uncaught Error: Assertion Failed: You must use Ember.set() to set the `linkDisabled` property (of <App.ApplicationController:ember294>) to `false`.

```

What's the proper way to do it?

Answer: 
In case you insist on using set/get:

```
Ember.set(this, 'linkDisabled', !(Ember.get(this, 'linkDisabled')));

```

But I would recommend to use `Ember.Object.toggleProperty()`, [API link here](http://emberjs.com/api/classes/Ember.Object.html#method_toggleProperty), try sth like:

```
this.toggleProperty('linkDisabled');

```
As of Ember 3.\* the way to do this is:

```
{{!-- Statically --}}
{{link-to 'photoGallery' disabled=true}}

{{!-- Dynamically --}}
{{link-to 'photoGallery' disabledWhen=controller.someProperty}}

```

[Source in Ember API Docs](https://www.emberjs.com/api/ember/3.2/classes/Ember.Templates.helpers/methods/get?anchor=link-to)