On Thursday, 6 November 2014 11:56:45 UTC+11, Eric Eslinger wrote: > > Seems like you could put a ng-readonly or ng-disabled attribute on the > thing in question. ng-disabled="scopevar.whatever", and then set > scopevar.whatever to truthy or falsy as needed. Let angular handle updating > the actual elements and attributes for you. >
Thanks Eric. I could do what you suggest, but that would mean having every single field on my form having the same ng-disabled and when you are talking about 30 - 50 fields, that sounds like a maintenance nightmare. > On Wed Nov 05 2014 at 4:39:09 PM KamBha <[email protected] <javascript:>> > wrote: > >> Hi, >> We have a requirement that we have a form that has to run in an "edit" >> mode and "view" mode. In edit mode, all fields are disabled. Compounding >> this, we also have a situation where certain fields need to be disabled >> until a checkbox is enabled. The solution I came up with is available in >> the plunkr below. The basic idea is that we have a view status object that >> has its own custom scope and all elements watch for changes on the custom >> scope. This could be a problem from a performance perspective, so I want >> to confirm if anyone has any ideas or comments about this behaviour? >> >> Thanks. >> >> Kamal. >> >> http://plnkr.co/edit/avyHPAfb7PrcLBHOxZPr?p=preview >> >> -- >> You received this message because you are subscribed to the Google Groups >> "AngularJS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/angular. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
