I want something like below
<a href="/Admin/MenuEdit/{{ResAdmin.adminController.selectionMenu}}">Edit Selected Menu</a>
selectionMenu is a variable in ResAdmin.adminController Ember Object.
In order to declare a binding for an attribute, you'll need to use bindAttr. You can use this helper to bind an attribute either to a global path or to a variable in the current context, such as your view.
For instance, you might have a template like this:
<a {{bindAttr href="menuUrl"}}>Edit Selected Menu</a>
Which is bound to a property in your view, like this:
App.MyView = Ember.View.extend({
menuUrl: function() {
return "/Admin/MenuEdit/" + this.get("App.adminController.selectionMenu");
}.property("App.adminController.selectionMenu)
});
I created a fiddle for this example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With