forked from melloc01/angular-input-stars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
91 lines (71 loc) · 3.56 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Angular Input Stars</title>
<link rel="stylesheet" type="text/css" href="bower_components/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="angular-input-stars.css">
</head>
<body >
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div ng-app="app" ng-controller="AppCtrl as App">
<input-stars ng-model="prop1" on-star-click="clickHandler(prop1)" max="5"></input-stars> value: {{prop1}}
<br>
<input-stars ng-model="prop2" max="5"></input-stars> value: {{prop2}}
<br>
<input-stars ng-model="App.prop3" max="5"></input-stars> value: {{App.prop3}}
<br>
<input-stars ng-model="App.prop4" max="5"></input-stars> value: {{App.prop4}}
<br>
<input-stars ng-model="App.prop5" max="5"></input-stars> value: {{App.prop5}}
<h3>Readonly</h3>
<div ng-init="enableReadonly = true">
<em>
<input type="checkbox" ng-model="enableReadonly" > Toggle readonly
</em>
<pre>{{ enableReadonly }}</pre>
</div>
<input-stars
ng-model="prop1"
max="5"
ng-attr-readonly="{{ enableReadonly || false }}"
ng-attr-icon-empty="{{ enableReadonly ? 'fa-twitter' : 'fa-circle-o' }}"
ng-attr-icon-full="{{ enableReadonly ? 'fa-cog' : 'fa-twitter' }}"
></input-stars> value: {{prop1}}
<br>
<input-stars ng-model="prop2" max="5" ng-attr-readonly="{{ enableReadonly || false }}"></input-stars> value: {{prop2}}
<br>
<input-stars ng-model="App.prop3" max="5" ng-attr-readonly="{{ enableReadonly || false }}"></input-stars> value: {{App.prop3}}
<br>
<input-stars ng-model="App.prop4" max="5" ng-attr-readonly="{{ enableReadonly || false }}"></input-stars> value: {{App.prop4}}
<br>
<input-stars ng-model="App.prop5" max="5" ng-attr-readonly="{{ enableReadonly || false }}"></input-stars> value: {{App.prop5}}
</div>
<script src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="angular-input-stars.js"></script>
<script type="text/javascript">
if (window.angular === undefined)
alert('Maybe you should run bower install first :]');
angular.module('app', ['angular-input-stars']);
angular.module('app').controller('AppCtrl', AppCtrl);
AppCtrl.$inject = ['$scope'];
function AppCtrl ($scope) {
$scope.clickHandler= function (prop) {
console.log(prop);
};
var vm = this;
$scope.prop1 = 1;
$scope.prop2 = 2;
vm.prop3 = 3;
vm.prop4 = 4;
vm.prop5 = 5;
}
</script>
</body>
</html>