项目作者: bndynet

项目描述 :
Extensions for Angular Directives, Filters...
高级语言: CoffeeScript
项目地址: git://github.com/bndynet/angular-more.git
创建时间: 2017-01-09T13:09:54Z
项目社区:https://github.com/bndynet/angular-more

开源协议:

下载


Angular More

Demo

This is the extensions about directives, filters for AngularJS.

Changelog

v3.0.0

  • Rename module bn.ui to nb.ui
  • All components starts with nb
  • Add methods as below:
    • angular.start(“ngApp”, {});
    • angular.resetForm($scope.formName);
    • angular.ajaxAll($http.get(…), $http.post(…)).then(function(values){});

v2.2.5

  • Update documentation and demo

v2.2.0

  • New directives: bn-ui-loading, bn-ui-html-editor

Dependencies

Requires:

  • angularjs
  • angular-sanitize
  • angular-date-time-input
  • angular-bootstrap-datetimepicker
  • bootstrap
  • bootstrap-more
  • momentjs

Quick start

  • Clone the repo

    git clone https://github.com/bndynet/angular-more.git

    git submodule init

    git submodule update

  • Update node modules

    npm install

What’s included

Within the download you’ll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You’ll see something like this:

  1. angular-more/
  2. ├── dist/
  3. ├── angular-more.css
  4. ├── angular-more.min.css
  5. ├── angular-more.js
  6. └── angular-more.min.js
  7. ├── demo/
  8. ├── test/
  9. └── src/

Usage

  1. <link href="lib/angular-bootstrap-datetimepicker/src/css/datetimepicker.css" rel="stylesheet"/>
  2. <!-- Latest compiled and minified CSS -->
  3. <link href="dist/angular-more.min.css" rel="stylesheet"/>
  4. <script src="lib/moment/min/moment.min.js"></script>
  5. <script src="lib/angular/angular.min.js"></script>
  6. <script src="lib/angular-date-time-input/src/dateTimeInput.js"></script>
  7. <script src="lib/angular-bootstrap-datetimepicker/src/js/datetimepicker.js"></script>
  8. <script src="lib/angular-bootstrap-datetimepicker/src/js/datetimepicker.templates.js"></script>
  9. <!-- Latest compiled and minified JavaScript -->
  10. <script src="dist/angular-more.min.js"></script>
  1. var app = angular.module("app", ["nb.ui"]);

Testing

Based on Jasmine and Karma.

Examples

Directives

bn-ui-input
  1. <div class="row">
  2. <bn-ui-input class="col-xs-4" label="Username" ng-model="model.username" required></bn-ui-input>
  3. <bn-ui-input class="col-xs-4" label="Birthday" ng-model="model.birthday" type="date" format="MM/DD/YYYY"></bn-ui-input>
  4. <bn-ui-input class="col-xs-4" label="Date Time" ng-model="model.datetime" type="datetime" format="MM/DD/YYYY h:mm a"></bn-ui-input>
  5. </div>
  6. `

bn-ui-select

  • ng-model=string
  • source={text: value}
  1. <bn-ui-select class="col-xs-4" label="Dropdown" ng-model="model.dropdown" source="model.source"></bn-ui-select>
  1. $scope.model = {
  2. source: {"option 1": "1", "option 2": "2"},
  3. dropdown: "2"
  4. };

bn-ui-checks

  • source={text: value}
  • multiple=true/false
  • with-icon=true/false
  • ng-model=object/[]
  • show-button=true/false
  1. <bn-ui-checks label="Radio/Checkbox" source="source" ng-model="model" multiple="true" with-icon="true" show-button="true"></bn-ui-checks>
  1. $scope.source = {
  2. "Option 1": "1",
  3. "Option 2": "2",
  4. "Option 3": "3",
  5. "Option 4": "4",
  6. "Option 5": "5",
  7. };
  8. $scope.model = ["2", "4"];

bn-ui-pager

  • ng-model={currentPage, pageSize, recordCount}
  • on-page=fn(page) //“page” is required
  1. <bn-ui-pager ng-model="{currentPage: 1, pageSize: 10, recordCount: 108 }" on-page="getData(page)"></bn-ui-pager>

Code and documentation (c) 2014-2017 Bndy.Net. Code released under the MIT License.