-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(uiView): Refactoring uiView directive to copy ngView logic #858
Conversation
The fix looks good, thanks for putting it together. Two things before I can merge it: (1) unit test (2) the commit message needs to be reformatted to comply with the contributor guidelines I'm happy to do it myself when I have some free time (probably not for a few days), or you can take care of it and update the PR. Totally up to you. |
Hi Nate, I'll fix it up later today. |
Awesome, thanks. |
@nateabele - I've changed the commit message and put in a regression test. Also, my editor has added a new line to the end of |
This still does not work. It fixes the lookup of the state information, but views still fail to render when the state of the ng-if has been flipped from on to off and then back to on. You can verify this by extending your unit test to flip the boolean's state for a second time. The problem seems to be that that the view directive uses a comment anchor as the insertion point for the views, but it inserts this into the template element. If the ng-if has re-rendered its contents, the template element containing the anchor is no longer attached to anything. I couldn't really say how to fix this. I don't understand why the directive is using a comment anchor in the first place. Does anyone actually understand the design of this directive, or is it just hacks upon hacks? The fact that this has been broken for months suggests not. |
@jonrimmer - I don't have the time at the moment to look more into this as what I've done actually fixes the issues I'm having. Huge deadline at work right now. I'll come back to this later and see if I can really fix this issue. |
As far as I understand it, this is necessary to properly handle animation. If anyone is interested in porting over the implementation for |
I'm going to have another stab at this. As for it using a HTML comment for animation, that shouldn't be the case. |
@nateabele - I've refactored Changes to Tests In the previous version of the tests, the first Know Issues Also pinging @christopherthielen as they were having the same issues. |
This should also fix #552 |
uiView was refactored to NOT transclude in commit a402415 2013-12-27. This commit switches back to transclude (which matches what ngView is doing). @nateabele, why switch from transclude back then? @meenie Assuming your changes don't break anything, it looks nice to me. This code is significantly easier to follow! |
@christopherthielen - Thanks :). It's a lot more "Angular" and less "fighting the man" I think. |
- Changed the structure of the uiView directive to work more like ngView. - Updated tests to work with new structure. - Updated tests so that all assertions actually run through AngularJS 1.0.8. - Added in extensive test for ngIf fix. - Added in ability for uiView to work with ngIf, ngRepeat, and ngClass. - Updated base AngularJS version to 1.2.14 to test $animate callbacks in 1.2.* - Fixes controllerAs so that it will work within a view declaration. Closes angular-ui#857, angular-ui#552
I've done more refactoring and Regarding Tests Known Issues
|
Well shit man, that saves me a ton of work! Thanks! 🍻 I've gotta step out, but I'll review the code as soon as I get back. |
For a preview of the new features, I have a shitty example right here :) - http://embed.plnkr.co/Dy5NHsq5eyaJPOJirsP6/preview You can show/hide using |
@meenie 😍 |
@meenie You, sir, are to be commended the GitHub Medal of Honor, the highest honor in the land (...actually I just made that up). Re-known issues... the 1.0.8 issue we can note in the FAQ. For 1.1.5, the In summary, very well done sir. Your efforts are sincerely appreciated. If I can wrangle up some people to test this against IE, I will happily tag this as 0.2.9. |
fix(uiView): Refactoring uiView directive to copy ngView logic
@nateabele @timkindberg - No worries! It was a great lesson on Directives :). There is a rabbit hole that you can get very far into... Luckily I came back out with only a few bumps and bruises haha. Re IE....who uses that anyway 😉 |
BTW, |
Can someone confirm: does this fix #774? |
@meenie Nice PR |
@marcghorayeb thanks 🍻! |
thanks a lot! |
Nice work! 👍 |
@meenie feel free to close any issues you find that this fixes. You rock so much dude. |
@nateabele there is already a 0.2.9... I thought you added it. |
@timkindberg - I'm not able to close issues. |
@meenie thanks a lot for this! I thought I wouldn't be able to count on ng-repeat working with A question: is it expected that I get comments like the following before every <!-- uiView: undefined --> This happens even on |
@gabrielmaldi - no worries :). I still think that using a As for the I'm not sure if this is a issue yet though.... |
You are part of the team now, so close issues until your heart is content. |
@timkindberg Thanks :). Will do! |
@nateabele - I fired up my windows machine and tested in Windows 8.1 using IE 11 and then using the developer tools to emulate 10, 9, and 8. Everything is working fine. |
@meenie Sounds good. I'll tag a release tomorrow, and look at getting Sauce Labs set up so we can have CI against multiple browsers. Thanks again for your work on this. |
Use the linking function element instead of the template element when setting the parent.
Fixes issue #857