Skip to content

Commit 1229b25

Browse files
committed
feat: Automate dollar prefixed property merges
1 parent 682dd21 commit 1229b25

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
8181

8282
## Release history
8383

84+
- 0.0.6
85+
- Add automated `$` prefixed properties to factory Object
8486
- 0.0.5
8587
- Add automatic function annotations
8688
- 0.0.4

dist/angular-component.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-component v0.0.5 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */
1+
/*! angular-component v0.0.6 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */
22
(function () {
33

44
var ng = angular.module;
@@ -57,12 +57,10 @@
5757

5858
}
5959

60-
if (options.$canActivate) {
61-
factory.$canActivate = options.$canActivate;
62-
}
63-
64-
if (options.$routeConfig) {
65-
factory.$routeConfig = options.$routeConfig;
60+
for (var key in options) {
61+
if (key.charAt(0) === '$') {
62+
factory[key] = options[key];
63+
}
6664
}
6765

6866
factory.$inject = ['$injector'];

dist/angular-component.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-component",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"main": "./dist/angular-component.min.js",
55
"description": "Angular component() polyfill",
66
"author": "@toddmotto",

src/angular-component.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@
5656

5757
}
5858

59-
if (options.$canActivate) {
60-
factory.$canActivate = options.$canActivate;
61-
}
62-
63-
if (options.$routeConfig) {
64-
factory.$routeConfig = options.$routeConfig;
59+
for (var key in options) {
60+
if (key.charAt(0) === '$') {
61+
factory[key] = options[key];
62+
}
6563
}
6664

6765
factory.$inject = ['$injector'];

0 commit comments

Comments
 (0)