1

I want to use ui-router, i'm using Netbeans when i add ui-view to a div element NB is telling me ui-view is not allowed as an attr at this point? why not whats wrong with it? here is my code that's not working.

<div id="kindle" ng-controller="kindle">
    <div class="container-fluid">
        <div ui-view="content"></div>
    </div>
</div>


<script type="text/javascript" src="../../../lib/angular/angular.js"></script>
<script type="text/javascript" src="../../../lib/angular-resource/angular-resource.js"></script>
<script type="text/javascript" src="../../../lib/angular-animate/angular-animate.js"></script>
<script type="text/javascript" src="../../../lib/angular-ui-router/release/angular-ui-router.js"></script>
Jamal
  • 21
  • 9

2 Answers2

3

Its most likely just not an attribute netbeans recognizes. All angular directives can be prefixed with data- so they appear just like an ordinary data attribute.

Use data-ui-view to solve your problem:

<div id="kindle" data-ng-controller="kindle">
    <div class="container-fluid">
        <div data-ui-view="content"></div>
    </div>
</div>

Many angular developers prefix their directives in this way so that their app will pass html validators that dont recognize the attributes.

See this question for more information: What is the difference between ng-app and data-ng-app?

Community
  • 1
  • 1
agconti
  • 17,780
  • 15
  • 80
  • 114
1

Add Angularjs plugins into NB

//Here's link For NB 7 http://plugins.netbeans.org/plugin/40296/angularjs-tools

or prefix all directive with data- as suggested by agconti

RootHacker
  • 1,109
  • 8
  • 12