-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
115 lines (104 loc) · 4.01 KB
/
demo.html
File metadata and controls
115 lines (104 loc) · 4.01 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html>
<head>
<title>ngTagsInput Demo</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script type="text/javascript" src="build/ng-tags-input.min.js"></script>
<link rel="stylesheet" type="text/css" href="build/ng-tags-input.min.css">
<style type="text/css">
body {
margin: 0px;
background-color: #cacaca;
font-family: Arial,sans-serif;
}
h1 {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.container {
width: 1000px;
margin: 0 auto;
padding: 10px;
background-color: #ffffff;
}
.container .section {
margin-bottom: 10px;
padding-bottom: 10px;
}
.superheroes .section:last-child {
margin-bottom: 0px;
padding-bottom: 0px;
}
.superheroes li {
background: linear-gradient(to bottom, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
}
.movies li {
background: linear-gradient(to bottom, rgba(230,240,163,1) 0%,rgba(210,230,56,1) 50%,rgba(195,216,37,1) 51%,rgba(219,240,67,1) 100%);
}
.movies li.selected {
background: linear-gradient(to bottom, rgba(157,213,58,1) 0%,rgba(161,213,79,1) 50%,rgba(128,194,23,1) 51%,rgba(124,188,10,1) 100%);
}
</style>
</head>
<body ng-app="myApp" ng-controller="ctrl">
<div class="container" ng-init="init()">
<h1>ngTagsInput Demo Page</h1>
<div class="section">
<tags-input ng-model="tags"></tags-input>
<p ng-cloak>Model: {{ tags.join(', ') }}</p>
<button ng-click="resetTags()">Reset</button>
</div>
<div class="section">
<tags-input ng-model="superheroes" ng-class="superheroes"
placeholder="Add a superhero"
replace-spaces-with-dashes="false"
enable-editing-last-tag="true"></tags-input>
<p ng-cloak>Model: {{ superheroes.join(', ') }}</p>
<button ng-click="resetSuperheroes()">Reset</button>
</div>
<div class="section">
<tags-input ng-model="movies" ng-class="movies" placeholder="Add a movie" replace-spaces-with-dashes="false"></tags-input>
<p ng-cloak>Model: {{ movies.join(', ') }}</p>
<button ng-click="resetMovies()">Reset</button>
</div>
</div>
<script>
angular.module('myApp', ['tags-input']).controller('ctrl', function($scope) {
$scope.init = function() {
$scope.resetTags();
$scope.resetSuperheroes();
$scope.resetMovies();
};
$scope.resetTags = function() {
$scope.tags = ['just','some','cool','tags'];
};
$scope.resetSuperheroes = function() {
$scope.superheroes = ['Batman', 'Superman', 'Flash', 'Iron Man', 'Hulk', 'Wolverine'];
};
$scope.resetMovies = function() {
$scope.movies = ['The Dark Knight',
'Heat',
'Inception',
'The Dark Knight Rises',
'Kill Bill: Vol. 1',
'Terminator 2: Judgment Day',
'The Matrix',
'Minority Report',
'The Bourne Ultimatum',
'Kill Bill: Vol. 2',
'Hot Fuzz',
'Serpico',
'The Fugitive',
'Casino Royale',
'Ghost Dog: The Way of the Samurai',
'Mission: Impossible',
'Die Hard',
'Die Hard: With a Vengeance',
'The Matrix Reloaded',
'Face/Off',
'Desperado',
'RoboCop'];
};
});
</script>
</body>
</html>