< AngularJS

AngularJS függvények

JSON formátum

index.html
<!doctype html>
<html ng-app="egyApp">
<head>
<meta charset="utf-8">
<title>SWBin</title>
<script src="http://code.angularjs.org/1.3.15/angular.min.js"></script>
 
<script>
var egyApp = angular.module("egyApp", []);
egyApp.controller("egyCtrl", function($scope) {
    $scope.tomb = ["szilva", "körte", "barack"];    
    $scope.a = $scope.tomb;
    $scope.b = angular.toJson($scope.tomb);
});
 
</script>
</head>
<body ng-controller="egyCtrl">
 
<div ng-bind="a"></div>
<div ng-bind="b"></div>
</body>
</html>
adat = angular.fromJson(jsonData);