This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 148687 [details] sample project Please check the attached project, controllers are defined like this: (function () { function PhoneListCtrl($scope, Phone) { $scope.phones = Phone.query(); $scope.orderProp = 'age'; } function PhoneDetailCtrl($scope, $routeParams, Phone) { $scope.phone = Phone.get({phoneId: $routeParams.phoneId}, function (phone) { $scope.mainImageUrl = phone.images[0]; }); $scope.neco =1; $scope.setImage = function (imageUrl) { $scope.mainImageUrl = imageUrl; } } var phonecatControllers = angular.module('phonecatControllers', []); phonecatControllers.controller('PhoneListCtrl', ['$scope', 'Phone', PhoneListCtrl]); phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', 'Phone', PhoneDetailCtrl]); })(); And with this pattern, code completion/go to declaration does not work in partials. This pattern comes from [1] Thank you [1] http://toddmotto.com/opinionated-angular-js-styleguide-for-teams/
CC should work now in partials if controllers are declared in IIFE and "controller as" pattern is used: (function () { function PhoneListCtrl(Phone) { this.phones = Phone.query(); this.orderProp = 'age'; } function PhoneDetailCtrl($routeParams, Phone) { this.phone = Phone.get({phoneId: $routeParams.phoneId}, function (phone) { this.mainImageUrl = phone.images[0]; }); this.neco = 1; this.setImage = function (imageUrl) { this.mainImageUrl = imageUrl; }; } var phonecatControllers = angular.module('phonecatControllers', []); phonecatControllers.controller('PhoneListCtrl', ['Phone', PhoneListCtrl]); phonecatControllers.controller('PhoneDetailCtrl', ['$routeParams', 'Phone', PhoneDetailCtrl]); })(); Other approaches should work as soon as the following two issue will be fixed: bug #250898 and bug #250899. http://hg.netbeans.org/web-main/rev/af1aa6fcfb41
Integrated into 'main-silver', will be available in build *201503050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/af1aa6fcfb41 User: Roman Svitanic <rsvitanic@netbeans.org> Log: #250892 and #246444: Better CC in AngularJS partials Task #250892 - No CC when controller registered using reference
Thank you, verified Product Version: NetBeans IDE Dev (Build 201503060001) Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25 Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25 System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)