How to create a dynamic table row using angular js

attribute.html

Attribute Value Language Position Add Option
Remove

controller.js

app.controller('attributeCtrl', function($scope, $http) {
	$scope.title = "New Attribute";
	$scope.detTitle = "Add attribute details";
	$scope.addValueSelected = true;
	$scope.attributeList = [];
	$scope.attributeValueList = [];
	$scope.valueEntered = true;
	$scope.attributeGroup=['Bangle','Chain','Ring'];
	//$scope.count = 0;
	$scope.valueCount =['juhi'];
	$scope.counter = 1;
	$scope.aValue = {name:"", group:"", values:[]};

    	
	$scope.addValueRow = function(){
		$scope.valueCount.push('juhi '+ $scope.counter);
    	$scope.counter++;
   	};
	$scope.removeFromList = function(id){
		$scope.valueCount.pop('juhi '+id);
		$scope.aValue.values.pop(id);
	};
});

AngularJS example for associative arrays

<html ng-app>
<head>
<script src="libs/angular.js"></script>
<script>
function myController($scope){
$scope.employee=[{"name":"ajith","job":"manager","salary":"$2000"},    {"name":"manoj","job":"clerk","salary":"$1000"}    ]    ;
}
</script>
</head>
<body ng-controller="myController">
<h2>List Example</h2>
<table>
<tr>
<td>Name</td>
<td>Job</td>
<td>Salary</td>
</tr>

<tr>
<td>{{employee[0].name}}</td>
<td>{{employee[0].job}}</td>
<td>{{employee[0].salary}}</td>
</tr>

<tr>
<td>{{employee[1].name}}</td>
<td>{{employee[1].job}}</td>
<td>{{employee[1].salary}}</td>
</tr>


</table>
<p>{{employee.name}}</p>
</body>
</html>

AngularJS example for handling form with elements

<html ng-app>
<head>
<script src="libs/angular.js"></script>
<script>
function formController($scope){
$scope.total=0;
$scope.num1=0;
$scope.num2=0;
$scope.calculate = function(){
$scope.total = parseInt($scope.num1) + parseInt($scope.num2);
}

}
</script>
</head>
<body ng-controller="formController">
<form>
<table>
<tr>
<td>Enter Number1</td><td>:<input ng-model="num1" ng-change="calculate()"/></td>
</tr>
<tr>
<td>Enter Number2</td><td>:<input ng-model="num2" ng-change="calculate()" /></td>
</tr>
</table>
<button
ng-click="calculate()">Calculate</button>
</form>
<p>{{total}}</p>
</body>
</html>

AngularJS script for handling textbox change event

<html ng-app>
<head>
<script src="libs/angular.js"></script>
<script>
function formController($scope){
$scope.empName="Rajeev";
$scope.changeName = function(){
$scope.empName="ARJUN";
}

}
</script>
</head>
<body ng-controller="formController">
<form>
<table>
<tr>
<td>Name</td><td>:<input ng-model="empName" ng-change="hello()" /></td>
</tr>
</table>
<button ng-click="changeName()">{{empName}}</button>
</form>
</body>
</html>

AngularJS example script for using objects

<html ng-app>
<head>
<script src="libs/angular.js"></script>
<script>
function myController($scope){
var person={};
person.name="James";
person.age="32";
person.salary="35000";

$scope.person = person;
}
</script>
</head>
<body ng-controller="myController">
<table>
<tr>
<td>Name</td><td>:{{person.name}}</td>
</tr>
<tr>
<td>Age</td><td>:{{person.age}}</td>
</tr>
<tr>
<td>Salary</td><td>:{{person.salary}}</td>
</tr>
</body>
</html>

Hello Node

// hello_node.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Node.js\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');

What is Java Atmosphere Framework ?

Atmosphere is a Java/Javascript Framework. It allows the creation of portable asynchronous web applications using Groovy, Scala & Java.

Atmosphere supports all modern web browsers. It also supports server components supporting all major Java based web servers.

It supports WebSockets, Server Side Events (SSE), Long Polling, HTTP Streaming, JSONP etc.

The aim of the framework is to allow a developer to write an application and let the framework discover, the best communication channel between the client and server, transparently.

For example, a developer can write an application that will use the Web Socket protocol when used with a browser on server that supports the protocol and transparently fail, changing to HTTP in ease where Web Socket isn’t supported