-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
93 lines (85 loc) · 3.42 KB
/
index.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
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
/// <reference path="lib/angular.1.2.7.js" />
/// <reference path="acute.select/acute.select.js" />
angular.module("index", ['acute.select', 'ui.bootstrap'])
.controller("MainCtrl", function ($scope) {
$scope.colours = [
{ name: 'black', id: 0 },
{ name: 'white', id: 1 },
{ name: 'red', id: 2 },
{ name: 'blue', id: 3 },
{ name: 'yellow', id: 4 },
{ name: 'orange', id: 5 },
{ name: 'purple', id: 6 },
{ name: 'green', id: 7 },
{ name: 'brown', id: 8 },
{ name: 'grey', id: 9 },
{ name: 'aquamarine', id: 10 }
];
$scope.selectedColour = $scope.colours[2]; // red.
$scope.colourChanged = function (value) {
var colourName = value ? value.name : "none";
$scope.message = "ac-change event fired for colour. New colour: " + colourName;
$scope.$digest();
};
$scope.selectedState = null;
// Return all states when dropdown first opens
$scope.getAllStates = function (callback) {
callback($scope.allStates);
};
$scope.stateSelected = function (state) {
$scope.stateInfo = state.name + " (" + state.id + ")";
}
$scope.allStates = [
{ "name": "Alabama", "id": "AL" },
{ "name": "Alaska", "id": "AK" },
{ "name": "Arizona", "id": "AZ" },
{ "name": "Arkansas", "id": "AR" },
{ "name": "California", "id": "CA" },
{ "name": "Colorado", "id": "CO" },
{ "name": "Connecticut", "id": "CT" },
{ "name": "Delaware", "id": "DE" },
{ "name": "District of Columbia", "id": "DC" },
{ "name": "Florida", "id": "FL" },
{ "name": "Georgia", "id": "GA" },
{ "name": "Hawaii", "id": "HI" },
{ "name": "Idaho", "id": "ID" },
{ "name": "Illinois", "id": "IL" },
{ "name": "Indiana", "id": "IN" },
{ "name": "Iowa", "id": "IA" },
{ "name": "Kansas", "id": "KS" },
{ "name": "Kentucky", "id": "KY" },
{ "name": "Lousiana", "id": "LA" },
{ "name": "Maine", "id": "ME" },
{ "name": "Maryland", "id": "MD" },
{ "name": "Massachusetts", "id": "MA" },
{ "name": "Michigan", "id": "MI" },
{ "name": "Minnesota", "id": "MN" },
{ "name": "Mississippi", "id": "MS" },
{ "name": "Missouri", "id": "MO" },
{ "name": "Montana", "id": "MT" },
{ "name": "Nebraska", "id": "NE" },
{ "name": "Nevada", "id": "NV" },
{ "name": "New Hampshire", "id": "NH" },
{ "name": "New Jersey", "id": "NJ" },
{ "name": "New Mexico", "id": "NM" },
{ "name": "New York", "id": "NY" },
{ "name": "North Carolina", "id": "NC" },
{ "name": "North Dakota", "id": "ND" },
{ "name": "Ohio", "id": "OH" },
{ "name": "Oklahoma", "id": "OK" },
{ "name": "Oregon", "id": "OR" },
{ "name": "Pennsylvania", "id": "PA" },
{ "name": "Rhode Island", "id": "RI" },
{ "name": "South Carolina", "id": "SC" },
{ "name": "South Dakota", "id": "SD" },
{ "name": "Tennessee", "id": "TN" },
{ "name": "Texas", "id": "TX" },
{ "name": "Utah", "id": "UT" },
{ "name": "Vermont", "id": "VT" },
{ "name": "Virginia", "id": "VA" },
{ "name": "Washington", "id": "WA" },
{ "name": "West Virginia", "id": "WV" },
{ "name": "Wisconsin", "id": "WI" },
{ "name": "Wyoming", "id": "WY" }
];
});