- //studenti.json
- [
- {
- "id": 1,
- "ime": "Borko",
- "prezime": "Dragojlovic",
- "mesto": "Mladenovo"
- },
- {
- "id": 2,
- "ime": "Petar",
- "prezime": "Petrovic",
- "mesto": "Novi Sad"
- },
- {
- "id": 3,
- "ime": "Janko",
- "prezime": "Dragojlovic",
- "mesto": "Novi Sad"
- },
- {
- "id": 4,
- "ime": "Marko",
- "prezime": "Markovic",
- "mesto": "Mladenovo"
- },
- {
- "id": 5,
- "ime": "Milos",
- "prezime": "Milosevic",
- "mesto": "Mladenovo"
- },
- {
- "id": 6,
- "ime": "Ivan",
- "prezime": "Ivanovic",
- "mesto": "Mladenovo"
- },
- ]
- //index.html
- <html>
- <head>
- <title> Angular primer </title>
- <script src="angular.min.js"></script>
- <script src="invoice.js"></script>
- </head>
- <body>
- <div ng-app="app1" ng-controller="appController">
- <li ng-repeat="student in studenti">
- <p>{{student.id}}</p>
- <p>{{student.ime}}</p>
- <p>{{student.prezime}}</p>
- <p>{{student.mesto}}</p>
- </li>
- </div>
- </body>
- </html>
- //invoice.js
- var myApp = angular.module('app1',[]);
- myApp.controller('appController', ['$scope', '$http',
- function($scope, $http) {
- $scope.studenti = null;
- $http.get('studenti.json').success (function(data){
- $scope.studenti = data;
- });
- }]);
SHARE
TWEET
http problem
a guest
Dec 25th, 2014
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

