Skip to content

Commit

Permalink
Fix for issue angular-ui#857
Browse files Browse the repository at this point in the history
Use the linking function element instead of the template element when setting the parent.
  • Loading branch information
Cody Lundquist committed Feb 4, 2014
1 parent f17b587 commit 3106953
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/viewDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ function $ViewDirective( $state, $compile, $controller, $injector, $ui

var directive = {
restrict: 'ECA',
compile: function (element, attrs) {
var initial = element.html(),
compile: function (tElement, attrs) {
var initial = tElement.html(),
isDefault = true,
anchor = angular.element($document[0].createComment(' ui-view-anchor ')),
parentEl = element.parent();
anchor = angular.element($document[0].createComment(' ui-view-anchor '));

element.prepend(anchor);
tElement.prepend(anchor);

return function ($scope) {
var inherited = parentEl.inheritedData('$uiView');
return function ($scope, element) {
var parentEl = element.parent(),
inherited = parentEl.inheritedData('$uiView');

var currentScope, currentEl, viewLocals,
name = attrs[directive.name] || attrs.name || '',
Expand Down

0 comments on commit 3106953

Please sign in to comment.