Skip to content

Commit b3a8eea

Browse files
committed
Merge pull request #147 from Gillespie59/development
0.2.3
2 parents 8a6a8f5 + b8a7c1e commit b3a8eea

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-angular",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "ESLint rules for AngularJS projects",
55
"main": "index.js",
66
"repository": {

rules/ng_function_type.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = function(context) {
3333
'CallExpression': function(node) {
3434

3535
var callee = node.callee,
36-
angularObjectName = callee.property.name,
36+
angularObjectName = callee.property && callee.property.name,
3737
firstArgument = node.arguments[1];
3838

3939
if(utils.isAngularComponent(node) && callee.type === 'MemberExpression' && angularObjectList.indexOf(angularObjectName) >= 0){

test/ng_function_type.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ valid.push({
5656
args: [1, 'anonymous', ['controller']]
5757
});
5858

59+
valid.push({
60+
code: 'var cleanUp;cleanUp = $rootScope.$on("$stateChangeSuccess", function () {vm.currentHor = $state.$current.path[0].self.name;});$scope.$on("$destroy", function () {cleanUp();});',
61+
args: [1, 'named']
62+
}, {
63+
code: 'var cleanUp;cleanUp = $rootScope.$on("$stateChangeSuccess", function () {vm.currentHor = $state.$current.path[0].self.name;});$scope.$on("$destroy", function () {cleanUp();});',
64+
args: [1, 'anonymous']
65+
});
66+
5967
invalid.push({
6068
code: 'app.controller("name", function(Service1){});',
6169
args: [1, 'named', ['controller']],

0 commit comments

Comments
 (0)