+ ngTagsInput
+
+ demo
+
+ {{ debug["ngtags"] | json }}
+ ngTagsInput control is implemented via Tags input directive for AngularJS .
You should include additional ng-tags-input.min.js
and ng-tags-input.min.css
and ng-tags-input.bootstrap.min.css
(if using bootstrap):
+<script src="https://cdnjs.cloudflare.com/ajax/libs/ng-tags-input/3.1.1/ng-tags-input.min.js"></script>
+
+<link href="https://cdnjs.cloudflare.com/ajax/libs/ng-tags-input/3.1.1/ng-tags-input.min.css" rel="stylesheet" media="screen">
+
+<link href="https://cdnjs.cloudflare.com/ajax/libs/ng-tags-input/3.1.1/ng-tags-input.bootstrap.min.css" rel="stylesheet" media="screen">
+Then add ngTagsInput
as module dependency:
+var app = angular.module("app", ["xeditable", "ngTagsInput"]);
+And finally set editable-tags-input
attribute pointing to model and add editable-tags-input-auto-complete
tag to do the auto complete criteria.
+
+
+
+ html
+ <div ng-controller="NgTagsCtrl">
+ <form data-editable-form name="ngTagsForm">
+ <div editable-tags-input="user.tags" data-e-form="ngTagsForm" data-e-name="tags" name="tags" data-e-ng-model="user.tags">
+ {{user.tags}}
+ <editable-tags-input-auto-complete source="loadTags($query)"></editable-tags-input-auto-complete>
+ </div>
+ <br/>
+ <div class="buttons">
+ <!-- button to show form -->
+ <button type="button" class="btn btn-default" ng-click="ngTagsForm.$show()" ng-show="!ngTagsForm.$visible">
+ Edit
+ </button>
+ <!-- buttons to submit / cancel form -->
+ <span ng-show="ngTagsForm.$visible">
+ <br/>
+ <button type="submit" class="btn btn-primary" ng-disabled="ngTagsForm.$waiting">
+ Save
+ </button>
+ <button type="button" class="btn btn-default" ng-disabled="ngTagsForm.$waiting" ng-click="ngTagsForm.$cancel()">
+ Cancel
+ </button>
+ </span>
+ </div>
+ </form>
+</div>
+ controller.js
+ app.controller('NgTagsCtrl', function($scope, $http) {
+ $scope.user = {
+ tags: [
+ { text: 'Tag1' },
+ { text: 'Tag2' },
+ { text: 'Tag3' }
+ ],
+ };
+
+ $scope.loadTags = function(query) {
+ return $http.get('/tags?query=' + query);
+ };
});
@@ -1291,7 +1389,7 @@ demo
{{ debug["editable-popover"] | json }}
- To made an editable field display in a popover, wrap the editable in <div class="item-wrapper">
.
+ To made an editable field display in a popover, wrap the editable in <div class="popover-wrapper">
.
Overview
to use power of angular and support complex forms / editable grids.Dependencies
Basically it does not depend on any libraries except AngularJS itself.
+For ui-select you may need to include angular-ui ui-select. +For ngTagsInput you may need to include mbenford ngTagsInput.For themes you may need to include Twitter Bootstrap CSS.
For some extra controls (e.g. datepicker) you may need to include angular-ui bootstrap. -For ui-select you may need to include angular-ui ui-select.
Controls & Features
Controls & Features
Get started
-demo
{{ user.number || 'empty' }}demo
+ngTagsInput
+ +demo
++
+ + + +
ngTagsInput control is implemented via Tags input directive for AngularJS .
+ +You should include additional
ng-tags-input.min.js
andng-tags-input.min.css
andng-tags-input.bootstrap.min.css
(if using bootstrap):Then add
+ +ngTagsInput
as module dependency:And finally set
+ + + +editable-tags-input
attribute pointing to model and addeditable-tags-input-auto-complete
tag to do the auto complete criteria.html
+ +controller.js
+demo
-To made an editable field display in a popover, wrap the editable in
+<div class="item-wrapper">
.To made an editable field display in a popover, wrap the editable in
<div class="popover-wrapper">
.