Skip to content

Commit

Permalink
Removing $timeout around template compilation to improve timing
Browse files Browse the repository at this point in the history
  • Loading branch information
busterbeans committed Dec 29, 2014
1 parent 2500f66 commit 5c45b84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nsPopover",
"version": "0.6.5",
"version": "0.6.6",
"homepage": "https://github.com/nohros/nsPopover",
"description": "Popover for angularjs library",
"authors": [
Expand Down
6 changes: 2 additions & 4 deletions example/nsPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@
$popover.addClass(options.theme);
}

// Add classes that identifies the pacement and alignment of the popver
// Add classes that identifies the placement and alignment of the popver
// which allows the customization of the popover based on its position.
$popover
.addClass('ns-popover-' + placement_ + '-placement')
.addClass('ns-popover-' + align_ + '-align');

$timeout(function() {
$compile($popover)(scope);
});
$compile($popover)(scope);

scope.$on('$destroy', function() {
$popover.remove();
Expand Down
6 changes: 2 additions & 4 deletions src/nsPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,13 @@
$popover.addClass(options.theme);
}

// Add classes that identifies the pacement and alignment of the popver
// Add classes that identifies the placement and alignment of the popver
// which allows the customization of the popover based on its position.
$popover
.addClass('ns-popover-' + placement_ + '-placement')
.addClass('ns-popover-' + align_ + '-align');

$timeout(function() {
$compile($popover)(scope);
});
$compile($popover)(scope);

scope.$on('$destroy', function() {
$popover.remove();
Expand Down

1 comment on commit 5c45b84

@httpete
Copy link

@httpete httpete commented on 5c45b84 Jan 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please revert this $timeout on line 211? I have nested directives inside the popover and without this, they don't render. I think it was put there originally for a reason. I just pulled master, and put

$timeout(function() {

  •          $compile($popover)(scope);
    
  •        });
    

back on 211 and it works perfectly.

Please sign in to comment.