Skip to content

Commit 33113bf

Browse files
committed
fix: Isolate scope when bindings is omitted
1 parent d781d17 commit 33113bf

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
8181

8282
## Release history
8383

84+
- 0.0.2
85+
- Bugfix isolate scope when `bindings` is omitted
8486
- 0.0.1
8587
- Initial release

dist/angular-component.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-component v0.0.1 | (c) 2015 @toddmotto | https://github.com/toddmotto/angular-component */
1+
/*! angular-component v0.0.1 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */
22
(function () {
33

44
var ng = angular.module;
@@ -40,11 +40,7 @@
4040
),
4141
templateUrl: makeInjectable(options.templateUrl),
4242
transclude: options.transclude === undefined ? true : options.transclude,
43-
scope: (
44-
options.isolate === false ?
45-
true :
46-
options.bindings
47-
),
43+
scope: (options.isolate === false ? true : (options.bindings || {})),
4844
bindToController: !!options.bindings,
4945
restrict: options.restrict || 'E'
5046
};

dist/angular-component.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-component",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"main": "./dist/angular-component.min.js",
55
"description": "Add .component() support for Angular 1.2+",
66
"author": "@toddmotto",

src/angular-component.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@
3939
),
4040
templateUrl: makeInjectable(options.templateUrl),
4141
transclude: options.transclude === undefined ? true : options.transclude,
42-
scope: (
43-
options.isolate === false ?
44-
true :
45-
options.bindings
46-
),
42+
scope: (options.isolate === false ? true : (options.bindings || {})),
4743
bindToController: !!options.bindings,
4844
restrict: options.restrict || 'E'
4945
};

0 commit comments

Comments
 (0)