-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
42 lines (33 loc) · 842 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
angular.module('studuApp', ['ui.router'])
.config(function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise('/');
$stateProvider
.state('home', {
url: '/',
templateUrl: '/static/home.html',
controller: 'FirstController'
})
.state('about', {
url: '/about',
templateUrl: '/static/about.html'
});
})
.controller('FirstController', function($scope, $http){
$scope.visible = true;
$scope.rotateCats = false;
$scope.test = 'Hide';
$http.get("info.json")
.then(function(response) {
$scope.persons = response.data.records;
});
$scope.addPerson = function() {
$scope.persons.push({id: 0,name: $scope.name, age: $scope.age, img: 'images/cat3.png'});
$scope.name = '';
$scope.age = 0;
};
})
.directive('helloWorld', function(){
return {
template: 'Hello World'
}
});