-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathangular-prompt.html
33 lines (29 loc) · 1.85 KB
/
angular-prompt.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
<div>
<div class="modal-header">
<button type="button" class="close pull-right" ng-click="$dismiss()" aria-hidden="true">×</button>
<h4 class="modal-title">{{options.title}}</h4>
</div>
<div class="modal-body">
<p ng-if="options.message">
{{options.message}}
</p>
<form id="cgPromptForm" name="form.cgPromptForm" ng-if="options.input" ng-submit="submit()">
<div class="form-group" ng-class="{'has-error':cgPromptForm.$invalid && changed}">
<label for="cgPromptInput">{{options.label}}</label>
<input id="cgPromptInput" type="text" class="form-control" placeholder="{{options.label}}" ng-model="input.name" required ng-change="changed=true" ng-if="!options.values || options.values.length === 0"/ autofocus="autofocus">
<div class="input-group" ng-if="options.values">
<input id="cgPromptInput" type="text" class="form-control" placeholder="{{options.label}}" ng-model="input.name" required ng-change="changed=true" autofocus="autofocus"/>
<div class="input-group-btn" dropdown>
<button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<li ng-repeat="value in options.values"><a href="" ng-click="input.name = value">{{value}}</a></li>
</ul>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button ng-repeat="button in options.buttons track by button.label" class="btn btn-default {{button.class}}" ng-class="{'btn-primary':button.primary}" ng-click="buttonClicked(button)">{{button.label}}</button>
</div>
</div>