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 245016

Summary: in an angularjs project I created a custom directive: <myDirective></myDirective>, in the html file I entered this directive and netbeans editor told me "Not allowed as child element of <div>" The editor does not understand angularjs directives
Product: web Reporter: douglasv <douglasv>
Component: AngularJSAssignee: Petr Pisl <ppisl>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ppisl
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: IDE log

Description douglasv 2014-06-12 14:40:13 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Comment 1 douglasv 2014-06-12 14:40:30 UTC
Created attachment 147652 [details]
IDE log
Comment 2 Vladimir Riha 2014-06-13 06:40:38 UTC
Yes, recognizing directives from their declaration in JS file is not supported. But HTML editor offers feature to "compensate" this:
 - in the HTML file, there is a bulb icon next to the line number of line with this <mydirective> element
 - click on the bulb icon and select "Add element mydirective to the project's custom elements"
 - error goes away and code completion in HTML editor will now also offer "mydirective"

The same can be done with attributes. I noticed there is a bug in this feature that when you have e.g. myDirective, NetBeans will "learn" mydirective (all lower case), I file a issue agains HTML editor. Workaround is to add the myDirective to project's custom elements (it adds mydirective), now open [projectFolder]/nbproject/customs.json and change mydirective to myDirective.
Comment 3 Roman Svitanic 2014-10-02 12:19:43 UTC

*** This bug has been marked as a duplicate of bug 234998 ***