Skip to content

Commit

Permalink
release 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Jun 3, 2016
1 parent f9592e1 commit 6ac1c61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
25 changes: 13 additions & 12 deletions release/angular-ui-router.js
@@ -1,6 +1,6 @@
/**
* State-based routing for AngularJS
* @version v0.3.0
* @version v0.3.1
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
Expand Down Expand Up @@ -3355,7 +3355,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
$urlRouter.update(true);

return $state.current;
}, function (error) {
}).then(null, function (error) {
if ($state.transition !== transition) return TransitionSuperseded;

$state.transition = null;
Expand Down Expand Up @@ -3986,7 +3986,7 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate,
}

if (currentEl) {
var $uiViewData = currentEl.data('$uiView');
var $uiViewData = currentEl.data('$uiViewAnim');
renderer.leave(currentEl, function() {
$uiViewData.$$animLeave.resolve();
previousEl = null;
Expand All @@ -3999,7 +3999,7 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate,

function updateView(firstTime) {
var newScope,
name = getUiViewName(scope, attrs, inherited, $interpolate),
name = getUiViewName(scope, attrs, $element, $interpolate),
previousLocals = name && $state.$current && $state.$current.locals[name];

if (!firstTime && previousLocals === latestLocals) return; // nothing to do
Expand All @@ -4022,14 +4022,14 @@ function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate,

var clone = $transclude(newScope, function(clone) {
var animEnter = $q.defer(), animLeave = $q.defer();
var viewData = {
name: name,
var viewAnimData = {
$animEnter: animEnter.promise,
$animLeave: animLeave.promise,
$$animLeave: animLeave
};

renderer.enter(clone.data('$uiView', viewData), $element, function onUiViewEnter() {
clone.data('$uiViewAnim', viewAnimData);
renderer.enter(clone, $element, function onUiViewEnter() {
animEnter.resolve();
if(currentScope) {
currentScope.$emit('$viewContentAnimationEnded');
Expand Down Expand Up @@ -4074,14 +4074,14 @@ function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate
var initial = tElement.html();
return function (scope, $element, attrs) {
var current = $state.$current,
$uiViewData = $element.data('$uiView'),
locals = current && current.locals[$uiViewData.name];
name = getUiViewName(scope, attrs, $element, $interpolate),
locals = current && current.locals[name];

if (! locals) {
return;
}

extend($uiViewData, { state: locals.$$state });
$element.data('$uiView', { name: name, state: locals.$$state });
$element.html(locals.$template ? locals.$template : initial);

var resolveData = angular.extend({}, locals);
Expand Down Expand Up @@ -4112,9 +4112,10 @@ function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate
* Shared ui-view code for both directives:
* Given scope, element, and its attributes, return the view's name
*/
function getUiViewName(scope, attrs, inherited, $interpolate) {
function getUiViewName(scope, attrs, element, $interpolate) {
var name = $interpolate(attrs.uiView || attrs.name || '')(scope);
return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));
var uiViewCreatedBy = element.inheritedData('$uiView');
return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));
}

angular.module('ui.router.state').directive('uiView', $ViewDirective);
Expand Down

0 comments on commit 6ac1c61

Please sign in to comment.