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 231988 - Code completion in AngularJS expression should offer properties of $scope
Summary: Code completion in AngularJS expression should offer properties of $scope
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: AngularJS (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-28 10:31 UTC by Petr Jiricka
Modified: 2013-08-21 11:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2013-06-28 10:31:02 UTC
1. Clone this project from GitHub: https://github.com/tastejs/todomvc
2. Import directory architecture-examples/angularjs using HTML Project from
Existing Sources wizard
3. Open js/controllers/todoCtrl.js and in the TodoCtrl function, add the following line (e.g. on line 27):         
   $scope.listname = "Default List";
4. In index.html, replace the text in the h1 element (todos) with {{
5. Press Ctrl+space

=> I would expect code completion to offer 'listname'.

Not sure if this needs to be addressed on the side of the HTML editor or the JavaScript editor.
Comment 1 Marek Fukala 2013-06-28 11:36:14 UTC
It's IMO matter of either the generated virtual source or the core js completion itself.
Comment 2 Petr Pisl 2013-08-20 20:26:30 UTC
There are more problems:

- If you write only {{ and not }}, then everything after {{ is treated as javascript code including the tags etc. It means that such js code is not parsable at all and basically I can do nothing with this. So user has to finish the delimiter {{}}.

- When you write {{}}, then everything between {{ and }} is a javascript code. But in the simple case {{}} there is no char that can be mapped to javascript virtual source. This should be fixed.
Comment 3 Petr Pisl 2013-08-20 20:50:37 UTC
I have fixed the case {{}} when there are open and close delimiters. The case with only open delimiter is not fixable in NB 7.4 timeframe.
Comment 4 Petr Jiricka 2013-08-21 11:38:08 UTC
Thanks, the case when closing braces are present works fine for me now, verifying. 

I entered a new enhancement issue 234714 to autocomplete the closing braces, so the user does not hit the case when it's not working so often.