Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we include angularjs component in Facelets page

I am new to angularjs, and was trying to create a sample angularjs in a Facelets file. But I am getting an error in the line <html ng-app> in Eclipse IDE. The error specifies that the ng-app attribute should be followed by an = character. Is it not possible to include angularjs code in a Facelets XHTML file?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ng="http://angularjs.org" ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
like image 406
aquero Avatar asked Oct 22 '22 02:10

aquero


1 Answers

Take a look at following:

  1. Try angular faces: https://github.com/stephanrauh/AngularFaces
  2. And there is also a project: https://github.com/pankajtandon/PointyPatient
  3. Prime faces refer to: http://angularprime.appspot.com/#/main

The best way is to go with HTML & JS as Client, and JAX-RS on Server Side.

I had similar problems, with Primefaces and Bootstrap, and became convinced, that JS & HTML at the moment is better for client side development.

like image 153
mavarazy Avatar answered Oct 23 '22 20:10

mavarazy