Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat(popover): added template as per requests in issue #220, took code from jbruni #2479

Closed
wants to merge 2 commits into from

Conversation

calekennedy
Copy link

There seemed to be a huge amount of interest in merging in the type of templating @jbruni was using in his fork. However his fork is outdated. This leads to a feature disparity between his fork and the core library. One of my projects requires features from both version, so I took it upon myself to merge them. Hopefully this merge will find its way into the core library where it will help other users who require both sets of functionality. 😄

@longsleep
Copy link

This looks great and simple - exactly what i need +1

@yurirenko
Copy link

Hi, @calekennedy
I'm using your fork right now and I've encountered a problem:
I have ng-change in the template. First time popover appears, everything works, but if I close and open it again the function bound to ng-change doesn't fire.

@Siyfion
Copy link

Siyfion commented Jul 22, 2014

Also, you say that @jbruni's fork is outdated, but it isn't...?

@yurirenko
Copy link

@Siyfion oh, actually I just checked @jbruni's fork and problem that I described doesn't appear. Thanks.
@calekennedy Also I noticed that datepicker doesn't work in your fork. At least for me.

@amcdnl
Copy link

amcdnl commented Jul 22, 2014

@calekennedy How do you pass scope to the new template?
@Yuri-G The date picker works for me.

@calekennedy
Copy link
Author

@Siyfion @jbruni is using a modified version of release 0.11 and core is using 0.12. Additionally, his fork was causing some state problems with the accordion directive.

@Yuri-G I have no trouble with datepicker and I am using it pretty extensively. If you put up a link to plunkr or something, maybe we could figure out why it's breaking.

@amcdnl The template is always going to be nested inside of a controller. The template will inherit its scope from this controller.

@amcdnl
Copy link

amcdnl commented Jul 24, 2014

@calekennedy I noticed you created a new template for this, is there anyway we can avoid having two templates for popovers?

@RobJacobs
Copy link
Contributor

+1 for this, very helpful, thanks...

@Siyfion
Copy link

Siyfion commented Aug 11, 2014

Holy moly. It got merged! Finally.

@RobJacobs
Copy link
Contributor

@calekennedy I'm noticing an issue similar to what @Yuri-G reported with binding ng-click in the template to the backing app controller. It works the first time the popover is opened but after that the backing function never gets hit. I set up a plunkr here to demonstrate: http://plnkr.co/edit/BoXoCxdXtIfmsdSTzOMU?p=preview The ui-bootstrap-tpls.js file I am using was built from this repository: https://github.com/calekennedy/bootstrap.git

UPDATE
It appears the removeTooltip function in the tooltipProvider causes this when it does:

 tooltip.remove();
 tooltip = null;

UPDATE

Changing

 tooltip.remove() to tooltip.detach(); 

fixed this issue for me, but I'm not sure of the implications. Also noticed in the tooltipProvider what seems to be an extra $digest in the createTooltip() function as $digest gets called again shortly after in the show() function.

@chrisirhc
Copy link
Contributor

#1848 is reviewed and ready to merge pending a name poll. Look there if you're interested in getting this feature.

Closing in favor of #1848.

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

Successfully merging this pull request may close these issues.

8 participants