GithubHelp home page GithubHelp logo

meanest-tea's Introduction

Mean Tea

This is an exercise in leaning AngularJS. It is a shopping cart application with two major concpetual parts:

  1. Inventory. The inventory is represented in a JSON file, which is loaded via an $http.get request. The user can see the inventory listed with details.

  2. Shopping Cart. The user can add a quantity of each item to a shopping cart from the home page. The user can then edit the quantity of items and/or remove items entirely from the cart page.

Angular Concepts

It demonstrates the following Angular concepts:

  1. Controllers. There are two controllers.
  • maincontroller controls the home/inventory page, and

  • cartcontroller controls the cart page.

  1. Services. There are two services which interact closely with the controllers.
  • teaservice fetches and paress the JSON data. Specifically, it returns an array of tea objects, and a list of tea categories.
  1. Directives. There is one custom directive, cb-teawidget, which does little more than expand to a HTML template. But it's a custom directive and I wrote it, so that's cool. That also means there's a cb-teawidget template.

  2. Filters There are two custom filters. Both are incredibly minor and were just exercises in writing filters.

  • cb_monetize divides by 100 and prepends a '$' to a number. It takes the place of {{ number / 100 | currency }}.

  • cb_assertTrue turns a true/false value into a yes/no value.

  1. Routing. There are two routes: home and cart. Both have their own partial page to load.

meanest-tea's People

Contributors

chrisman avatar

Watchers

James Cloos avatar Aubrey Ford 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.