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.

Bug 242570

Summary: Support for "controller as" syntax
Product: web Reporter: Vladimir Riha <vriha>
Component: AngularJSAssignee: Roman Svitanic <rsvitanic>
Status: VERIFIED FIXED    
Severity: normal CC: Juergen.Zimmermann, ppisl
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 247480    
Attachments: sample project

Description Vladimir Riha 2014-03-05 09:23:58 UTC
Angular 1.2 brings new syntax/logic "controller as". It can be used in ng-controller as well as in routing and it enables to use any property declared in controller via "this" in partial file, so $scope might not be used at all. It is quite a big change. For examples, please check [1]

[1] http://css.dzone.com/articles/%E2%80%9Ccontroller-as%E2%80%9D-syntax-angular
Comment 1 Vladimir Riha 2014-05-23 13:01:52 UTC
*** Bug 244695 has been marked as a duplicate of this bug. ***
Comment 2 Roman Svitanic 2014-09-23 13:37:30 UTC
implemented in web-main:
http://hg.netbeans.org/web-main/rev/9e5dbe154e2e
Comment 3 Vladimir Riha 2014-09-23 13:58:03 UTC
Thanks a lot Romane. I'll try it and cover it with qa tests this/next week.
Comment 4 Quality Engineering 2014-09-24 12:49:32 UTC
Integrated into 'main-silver', will be available in build *201409241121* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9e5dbe154e2e
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #242570 - Support for "controller as" syntax [AngularJS]
Comment 5 Vladimir Riha 2014-09-25 16:20:41 UTC
I'm sorry but it is not complete. There are several ways to define controller in AngularJS and one common (because it does not pollute global namespace) is in the attached project. If you try code completion/go to declaration in partial1.html for ct1 (or partial2.html for ct2), it does not offer relevant properties.

Thank you


Product Version: NetBeans IDE Dev (Build web-main-1322-on-20140925)
Java: 1.8.0_20; Java HotSpot(TM) Client VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b26
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 6 Vladimir Riha 2014-09-25 16:21:06 UTC
Created attachment 149522 [details]
sample project
Comment 7 Vladimir Riha 2014-09-26 07:04:05 UTC
I'm sorry Roman, after fixing the typo, it works just fine. Please close it again, I won't reopen it this time :) Thank you
Comment 8 Roman Svitanic 2014-09-26 08:15:42 UTC
Thanks for the verification. Therefore I am closing this as fixed.
Comment 9 Vladimir Riha 2014-09-26 09:37:20 UTC
Thank you, verified


Product Version: NetBeans IDE Dev (Build web-main-1322-on-20140925)
Java: 1.8.0_20; Java HotSpot(TM) Client VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b26
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)