Skip to content

Commit

Permalink
fix(builder): define $scope to undefined to fallback on $rootScope
Browse files Browse the repository at this point in the history
Close #39
  • Loading branch information
davinkevin committed Jun 27, 2016
1 parent 8839932 commit 967d919
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class SubscribeBuilder {
this.queue = queue;
this.aCallback = angular.noop;
this.headers = {};
this.scope = {};
this.scope = undefined;
this.json = false;
this.digest = true;

Expand Down
6 changes: 3 additions & 3 deletions core/builder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Builder', () => {

it('should subscribe with default parameters', () => {
builder.build();
expect(ngStomp.subscribe.calls.mostRecent().args).toEqual([firstTopic, angular.noop, {}, {}, false, true])
expect(ngStomp.subscribe.calls.mostRecent().args).toEqual([firstTopic, angular.noop, {}, undefined, false, true])
});

it('should subscribe', () => {
Expand Down Expand Up @@ -59,11 +59,11 @@ describe('Builder', () => {
.connect();

expect(ngStomp.subscribe.calls.argsFor(0)).toEqual([firstTopic, aCallback, headers, $scope, false, true]);
expect(ngStomp.subscribe.calls.argsFor(1)).toEqual([secondTopic, angular.noop, {}, {}, false, false]);
expect(ngStomp.subscribe.calls.argsFor(1)).toEqual([secondTopic, angular.noop, {}, undefined, false, false]);

expect(unSubscriber.connections).toEqual([
transformToConnection(firstTopic, aCallback, headers, $scope, false, true, 0),
transformToConnection(secondTopic, angular.noop, {}, {}, false, false, 1)
transformToConnection(secondTopic, angular.noop, {}, undefined, false, false, 1)
]);
});

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-stomp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-stomp.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-stomp.min.js.map

Large diffs are not rendered by default.

0 comments on commit 967d919

Please sign in to comment.