Skip to content

Commit 3106953

Browse files
author
Cody Lundquist
committed
Fix for issue angular-ui#857
Use the linking function element instead of the template element when setting the parent.
1 parent f17b587 commit 3106953

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/viewDirective.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ function $ViewDirective( $state, $compile, $controller, $injector, $ui
7070

7171
var directive = {
7272
restrict: 'ECA',
73-
compile: function (element, attrs) {
74-
var initial = element.html(),
73+
compile: function (tElement, attrs) {
74+
var initial = tElement.html(),
7575
isDefault = true,
76-
anchor = angular.element($document[0].createComment(' ui-view-anchor ')),
77-
parentEl = element.parent();
76+
anchor = angular.element($document[0].createComment(' ui-view-anchor '));
7877

79-
element.prepend(anchor);
78+
tElement.prepend(anchor);
8079

81-
return function ($scope) {
82-
var inherited = parentEl.inheritedData('$uiView');
80+
return function ($scope, element) {
81+
var parentEl = element.parent(),
82+
inherited = parentEl.inheritedData('$uiView');
8383

8484
var currentScope, currentEl, viewLocals,
8585
name = attrs[directive.name] || attrs.name || '',

0 commit comments

Comments
 (0)