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 258232

Summary: Editor shows error / warning "Bad value X for attribute Y on element Z" in AngularJS template
Product: web Reporter: vkary
Component: AngularJSAssignee: Roman Svitanic <rsvitanic>
Status: NEW ---    
Severity: normal CC: ppisl
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 8.1   
Issue Type: DEFECT Exception Reporter:

Description vkary 2016-03-03 15:21:51 UTC
In an AngularJS HTML / template file I have code like this:

    <canvas 
        ng-show="true"
        id="mask" 
        class="mask" 
        width="{{ps.width}}" 
        height="{{ps.height}}" 
        style="position:absolute;">No canvas support
    </canvas>
    <img 
        id="mask2" 
        class="mask2" 
        width="{{ps.width}}" 
        height="{{ps.height}}" 
        style="position:absolute;">No canvas support
    />

The editor marks the whole IMG tag with red background color (dark theme) and the hint says something like:

- Bad value "{{ps.width}}" for attribute "width" on element "img": Expected a digit but saw "{" instead.

The CANVAS element has also the same WIDTH attribute with the same declaration, but there is no error / warning.

If I add any ng-directive tag somewhere in the IMG tag, like this:

    <img 
        ng-show="true" 
        id="mask2" 
        class="mask2" 
        width="{{ps.width}}" 
        height="{{ps.height}}" 
        style="position:absolute;">No canvas support
    />

no error / warning is showing any more.

The correct behavior should be not to mark the element as wrong even without a ng-directive tag.
Comment 1 vkary 2016-03-07 11:34:32 UTC
A small correction in the example code; it should be like this:

    <canvas 
        ng-show="true"
        id="mask" 
        class="mask" 
        width="{{ps.width}}" 
        height="{{ps.height}}" 
        style="position:absolute;">No canvas support
    </canvas>
    <img 
        id="mask2" 
        class="mask2" 
        width="{{ps.width}}" 
        height="{{ps.height}}" 
        style="position:absolute;"
    />

(">No canvas support" from IMG tag removed)