jow- / luci-ng

LuCI on Angular
84 stars 26 forks source link

base: update to angular 1.5 and boostrap ui 2.1 #25

Closed ianchi closed 7 years ago

ianchi commented 7 years ago

Update libraries to more up to date versions, so all APIs are adjusted before code base growths to much. Main changes:

jow- commented 7 years ago

Hi @ianchi - I just wanted to leave a note here to tell you that I didn't forget about those PRs - I hope to have them reviewed within the next days.

ianchi commented 7 years ago

Change logic to decentralize wait functions to each element. Add a block on cbiMap while in any wait operation.

As per discussion in PR #22

ianchi commented 7 years ago

@jow- please let me know what you think about this approach.

I still have a pending issue with cbiNetworkList and cbiDeviceList. I need to look more carefully at the code, but for this controls I can't find the binding of element to model data. They don't see any ng-model directive. If you can hint how it is done, it will save me some time.

jow- commented 7 years ago

@ianchi - I like the lock count approach and am currently in the process of testing your changes.

The cbiNetworkList and cbiDeviceList widgets do not bind to the data model through directives but propagate the user choice through ng-click events which call select(). The select function takes care of normalizing the input value and storing it in the data model.

ianchi commented 7 years ago

@jow- sorry I wasn't very specific. What I don't see is how changes in the model propagate to the control (after init). Specifically, after a reset.

jow- commented 7 years ago

@ianchi - ah, now I get you. Well there is no model binding at all atm since back when I started to implement the CBI directives I had some troubles using shared states etc.

But now that I think about it, making the sub-directive observe things like .uciValue of the owner option would simplify a lot of things but I do not know how to properly implement that yet - I guess by using $watch ?

ianchi commented 7 years ago

yes, I think that might be the easiest right now. An alternative way could be to use the same ngModel approach, but you need a form control to bind, so include a hidden