disable not working in ng-options in angularjs v1.1.5

46 views
Skip to first unread message

Arun kumar

unread,
Oct 26, 2018, 5:52:16 AM10/26/18
to Angular and AngularJS discussion
Hi,

I am implementing this below link code into my code, but the disable keyword is not working in v1.1.5, currently it's wokring v1.4
any workaround to use disable in ng-options

here's the working link which uses angularjs v1.4


how do I get disale working in ng-options in v1.1.4

Sander Elias

unread,
Oct 26, 2018, 10:55:25 AM10/26/18
to Angular and AngularJS discussion
Hi Arun,

By backporting all the fixes from 1.5 to 1.1.
Is there a reason you can't upgrade to a newer version?

Regards
Sandeer

Arun kumar

unread,
Oct 26, 2018, 1:39:19 PM10/26/18
to Angular and AngularJS discussion
Hi sander,

I can't upgrade to newer version, the company I am working, they are using older version they won't upgrade whole application for a single enhancement.
Any workaround on using 'disable when' in ng-repeat ?

Zlatko Đurić

unread,
Oct 27, 2018, 8:36:51 AM10/27/18
to Angular and AngularJS discussion
Not a workaround, but a solution. If you don't want to upgrade angular to a version that has this feature, you have to implement the feature yourself. So you can tell the management in the company that upgrading angular costs X, and developing just this feature costs Y. It's quite likely that Y in this particular case is significantly cheaper. But if you had two or three such features, X might turn out better in the long run.
It's on them you decide, and on you to implement the decision.

Now, how would this work?
Simple, create a directive that renders these options on your own, and then disables or enables specific options given the proper input data for the directive. Shouldn't be too hard, try it, and if you get stuck, let us know where you got stuck and somebody can take a look.

Sander Elias

unread,
Oct 27, 2018, 1:14:45 PM10/27/18
to Angular and AngularJS discussion
Hi Arun,

What Zlatko said, Also search this group, I'm pretty sure I created exactly this thing before it was added to angular.

Regards
Sander

Arun kumar

unread,
Oct 29, 2018, 4:04:19 AM10/29/18
to Angular and AngularJS discussion
Thanks Zlatko and Sander for replying,
I have created a workaround for this,
Instead of using disable when in ng-repeat, I have used ng-change and ng-disable, now it's working fine.
Reply all
Reply to author
Forward
0 new messages