i have written a simple factory service. here the link to the fiddle http://jsfiddle.net/#&togetherjs=caUQB0merH I am unable to determine why the fiddle is not working. Can any one point out the problem
Thanks in advance
Update:--
<script>
var StudentModule=angular.module("StudentModule",[]);
function factoryfuc()
{
return[
{name:"maclean", age:"22"},
{name:"sachin", age:"25"}
];
}
StudentModule.factory('Studentfactory',factoryfuc);
function StudentController($scope,Studentfactory)
{
$scope.students=Studentfactory;
}
</script>
<div ng-app="StudenModule" ng-controller="StudentController">
<table ng-repeat="student in students"><tr><td>{{student.name}}</td><td>{{student.age}}</td></tr></table>
</div>
I am using the up-to-date version of Angular and this is working well: http://jsbin.com/eQIVuQi/1/edit
The code I am going to include in this post is your code modified to follow proper naming conventions and better practices.
Markup:
JavaScript:
Live demo here (click).