Question

I'm inside my view.xthml which has facelets component in there. Like:

<ui:composition template="/layout.xhtml"> .. whatever

Being there I try to integrate AngualerJS, putting ng-view, like this:

   <div ng-view> </div>

When my /view.jsf is rendering I got server side error:

Attribute name "ng-view" associated with an element type "div" must be followed by the ' = ' character.

So, it validates my html that prevents angular ng-view to start working.

The question is: how to integrate angularjs and its ng-view with jsf/facelets based on my case?

Was it helpful?

Solution

Facelets is a XML based view technology which uses XHTML to generate HTML output. In XML, each element attribute must have a value.

You can indeed assign it an empty string as value, but ng-view="true" or ng-view="ng-view" would be more self-documenting, keeping checked="checked" and selected="selected" in mind.

<div ng-view="true">

OTHER TIPS

<div ng-view = "">

Looks not nice but it works for me on that stage (of getting rid of jsf).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top