Skip to content

Commit

Permalink
fixed sref to call update rather than apply which caused incorretc ev…
Browse files Browse the repository at this point in the history
…aluation of value.
  • Loading branch information
jeme committed Jul 14, 2014
1 parent 7b927ba commit c90c21e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions build/angular-routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3281,6 +3281,10 @@ var State = (function () {
return isDefined(this.route) ? this.route.route : isDefined(this.parent) ? this.parent.resolveRoute() : '';
};

State.prototype.is = function (state) {
return this.fullname === state || this.fullname === rootName + '.' + state;
};

State.prototype.clear = function (route) {
forEach(this._children, function (state) {
state.clear(route);
Expand All @@ -3293,10 +3297,6 @@ var State = (function () {
this._children = {};
};

State.prototype.is = function (state) {
return this.fullname === state || this.fullname === rootName + '.' + state;
};

State.prototype.isActive = function (state) {
if (this.is(state)) {
return true;
Expand Down Expand Up @@ -3930,7 +3930,7 @@ var jemLinkDirective = [
}

//NOTE: Should we also use watch for sref, it seems rather unlikely that we should be interested in that.
attrs.$observe('sref', apply);
attrs.$observe('sref', update);
} else {
element.bind('click', onClick);
}
Expand Down
2 changes: 1 addition & 1 deletion build/angular-routing.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/src/directives/jemLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var jemLinkDirective = [
}

//NOTE: Should we also use watch for sref, it seems rather unlikely that we should be interested in that.
attrs.$observe('sref', apply);
attrs.$observe('sref', update);
} else {
element.bind('click', onClick);
}
Expand Down
8 changes: 4 additions & 4 deletions build/src/state/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ var State = (function () {
return isDefined(this.route) ? this.route.route : isDefined(this.parent) ? this.parent.resolveRoute() : '';
};

State.prototype.is = function (state) {
return this.fullname === state || this.fullname === rootName + '.' + state;
};

State.prototype.clear = function (route) {
forEach(this._children, function (state) {
state.clear(route);
Expand All @@ -137,10 +141,6 @@ var State = (function () {
this._children = {};
};

State.prototype.is = function (state) {
return this.fullname === state || this.fullname === rootName + '.' + state;
};

State.prototype.isActive = function (state) {
if (this.is(state)) {
return true;
Expand Down
10 changes: 5 additions & 5 deletions gh-pages/assets/scripts/angular-routing/impl/angular-routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3281,6 +3281,10 @@ var State = (function () {
return isDefined(this.route) ? this.route.route : isDefined(this.parent) ? this.parent.resolveRoute() : '';
};

State.prototype.is = function (state) {
return this.fullname === state || this.fullname === rootName + '.' + state;
};

State.prototype.clear = function (route) {
forEach(this._children, function (state) {
state.clear(route);
Expand All @@ -3293,10 +3297,6 @@ var State = (function () {
this._children = {};
};

State.prototype.is = function (state) {
return this.fullname === state || this.fullname === rootName + '.' + state;
};

State.prototype.isActive = function (state) {
if (this.is(state)) {
return true;
Expand Down Expand Up @@ -3930,7 +3930,7 @@ var jemLinkDirective = [
}

//NOTE: Should we also use watch for sref, it seems rather unlikely that we should be interested in that.
attrs.$observe('sref', apply);
attrs.$observe('sref', update);
} else {
element.bind('click', onClick);
}
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ module.exports = function (grunt) {

// Default task.
grunt.registerTask('default', ['clean', 'build', 'karma']);
grunt.registerTask('develop', ['watch']);
grunt.registerTask('develop', ['build', 'connect:devdocs', 'watch']);

grunt.registerTask('build', ['tslint', 'typescript', 'concat', 'uglify', 'ngdocs', 'copy:ngdocs', 'clean:temp']);
};
2 changes: 1 addition & 1 deletion src/directives/jemLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var jemLinkDirective = [<any>'$state', '$route',
scope.$watch(attrs.params, update, true);
}
//NOTE: Should we also use watch for sref, it seems rather unlikely that we should be interested in that.
attrs.$observe('sref', apply);
attrs.$observe('sref', update);
} else {
element.bind('click', onClick);
}
Expand Down

0 comments on commit c90c21e

Please sign in to comment.