angular-query-builder

WebJar for angular-query-builder

Лицензия

Лицензия

MIT
Категории

Категории

Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

angular-query-builder
Последняя версия

Последняя версия

1.3.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-query-builder
WebJar for angular-query-builder
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/tiste/angular-query-builder

Скачать angular-query-builder

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/angular-query-builder/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>angular-query-builder</artifactId>
    <version>1.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/angular-query-builder/
implementation 'org.webjars.npm:angular-query-builder:1.3.0'
// https://jarcasting.com/artifacts/org.webjars.npm/angular-query-builder/
implementation ("org.webjars.npm:angular-query-builder:1.3.0")
'org.webjars.npm:angular-query-builder:jar:1.3.0'
<dependency org="org.webjars.npm" name="angular-query-builder" rev="1.3.0">
  <artifact name="angular-query-builder" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='angular-query-builder', version='1.3.0')
)
libraryDependencies += "org.webjars.npm" % "angular-query-builder" % "1.3.0"
[org.webjars.npm/angular-query-builder "1.3.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

angular-query-builder

Query builder as JSON from angular directive

Install

$ npm install -SE angular-query-builder

Add it as an angular dependency:

angular.module('app', [
    'ngQueryBuilder',
]);

Usage

Simply define an options object:

$scope.options = {
    fields: [
        { name: 'Firstname', value: 'firstname' },
        { name: 'Birthdate', value: 'birthdate', attrs: { type: 'date' } },
        { name: 'City', value: 'city', attrs: { type: 'text', 'required': true } },
        { name: 'Country', value: 'country' },
    ],

    // optional operators
    operators: [
        { name: 'AND', value: '$and' },
        { name: 'OR', value: '$or' },
    ],

    // ... and conditions
    conditions: [
        { name: 'equal', value: '$eq' },
        { name: 'is not equal', value: '$neq' },
        { name: 'less than', value: '$lt' },
        { name: 'less than or equal', value: '$lte' },
        { name: 'greater than', value: '$gt' },
        { name: 'greater than or equal', value: '$gte' },
    ],
};

Then add the directive to your view:

<div query-builder="options"></div>

You can now get the result as {{options.query}}

Templating

You can use your own template by setting a templateUrl in the directive:

<div query-builder="options" template-url="templateUrl"></div>

or

$scope.options = {
    templateUrl: '/src/query-builder-group-directive.html',
};

The template needs to be recursive. You can have a look at the project one.

Build

Just run npm run dev to start webserver, and build everything with npm run build

Want to help?

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes using commitizen (git commit -am 'feat: add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT

Версии библиотеки

Версия
1.3.0