Giter Site home page Giter Site logo

rasata / angular-reservation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hmartos/angular-reservation

0.0 2.0 0.0 1.25 MB

AngularJS configurable module to set up an appointment on a calendar. It can be used to make a reservation in a restaurant, clinic, barber shop, or any kind of service provided in time slots

License: MIT License

JavaScript 70.52% CSS 1.72% HTML 27.77%

angular-reservation's Introduction

angular-reservation

Build Status

AngularJS configurable module to set up an appointment on a calendar. It can be used to make a reservation in a restaurant, clinic, barber shop, or any kind of service provided in time slots.

Requirements

How to use it in your existing project

Install module with bower

Execute bower install --save angular-reservation

Load scripts

Load AngularJS, dependencies script files and the script file angular-reservation.min.js in your index.html.

<!-- Angular reservation dependencies -->
<script type="text/javascript" src="bower_components/angular-bootstrap/ui-bootstrap.min.js"></script>
<script type="text/javascript" src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script type="text/javascript" src="bower_components/angular-translate/angular-translate.min.js"></script>
<script src="bower_components/angular-messages/angular-messages.min.js"></script>
<!-- Angular reservation minified -->
<script type="text/javascript" src="bower_components/angular-reservation/dist/angular-reservation.min.js"></script>

Load styles

Load bootstrap css and angular-reservation.min.css in your index.html.

<!-- Compiled and minified Bootstrap CSS -->
<link rel="stylesheet" href="components/bootstrap/bootstrap.min.css">
<!-- Angular reservation minified css -->
<link rel="stylesheet" href="bower_components/angular-reservation/dist/angular-reservation.min.css">

Add module dependency

Add 'hm.reservation' to the list of module dependencies.

angular.module('myApp', [
    'hm.reservation'
])

HTML Markup

Add angular-reservation directive in an html page.

<!-- angular-reservation directive -->
<reservation></reservation>

Setup

Configure module.

//Minimal configuration of reservation module
angular.module('myApp').config(function (reservationConfigProvider) {
    var config = {
        getAvailableHoursAPIUrl: "http://API-URL/availableHours", //API url endpoint to load list of available hours
        reserveAPIUrl: "http://API-URL/reserve", //API url endpoint to do a reserve
    };

    reservationConfigProvider.set(config);
});

Build

When there is any change on the sources of this module, you should build the module again to generate dist folder with minified files. To build the module just use the following command:

gulp build

There is also a watch task to watch for any change on sources files and automatically generate dist files. Just use the following command:

gulp watch

Running tests

angular-reservation has in`tegration tests that allows developer to check if new features breaks functionality. You can run tests on a single run or watch for source code to change and execute tests each time source code changes.

Single run test

Execute npm run test-single-run

Watch for source code and execute tests each time source code changes

Execute npm run test

angular-reservation's People

Contributors

hmartos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.