Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

How to add ui-sortable attribute conditionally? #397

Closed
im1dermike opened this issue Oct 28, 2015 · 1 comment
Closed

How to add ui-sortable attribute conditionally? #397

im1dermike opened this issue Oct 28, 2015 · 1 comment

Comments

@im1dermike
Copy link

It does not appear this directive has the ability to be added conditionally. If you attempted to implement this functionality like it's implemented for required and ng-required...

This: <ul ng-model="items" ui-sortable>

Would look like this: <ul ng-model="items" ui-sortable="isSortable">

Unfortunately, ui-sortable was designed to be able to take an optional options value. I believe this is also what makes the built-in ngAttr directive not work. https://docs.angularjs.org/guide/directive#text-and-attribute-bindings

Any way to get around this?

@thgreasi
Copy link
Contributor

A disabled option actually exists and should be a perfect match for your use case.
Does it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants