Skip to content

Repository files navigation

Angular Store

A pet-store demo built with AngularJS 1.x, written to practice custom modules, directives, and providers rather than to be a real shop.

▶ View the site — see the note below on what no longer works.

Important

Archived, and partly non-functional. Two backing services are gone:

  • Firebase — the mattsauroangularstore project has been deactivated, so registration, login, and logout all fail. The database returns 423 Locked.
  • api.adorable.io — the avatar service used for review avatars shut down; the endpoint now redirects to a landing page, so avatars don't render.

The product catalogue is served from a local pets.json, so browsing, tabs, and reviews still work. Kept as a record of the work, not as a running app. It is not maintained.

How it works

Two modules: myApp (the application) and storeProducts (a reusable module holding the store-specific pieces), wired together at declaration:

var app = angular.module("myApp", ["storeProducts", "ngRoute"]);

storeProducts is the interesting half. It defines two directives backed by templates — storePanels for the tabbed product view and storeReviews for the review form — plus an avatar provider, which is the practice piece: a provider rather than a plain service, exercising the $get factory form.

Routes map /, /page1, /page2, and /login onto templates in templates/. Auth is Firebase email/password, with onAuthStateChanged calling $scope.$apply() to pull Firebase's callback back into Angular's digest cycle — the comment in app.js explaining why is worth keeping.

File Role
app.js Module declaration, routes, auth controllers
modules/storeProducts.js Directives and the avatar provider
templates/ Route and directive templates
pets.json The product catalogue
login.html Login/registration view
stylesheet.less / .css Styles (LESS source and compiled output)

Built with AngularJS 1.x, ngRoute, Bootstrap, and Firebase.

Running locally

No build step. Serve the folder — file:// won't work, since routes and directives fetch their templates over HTTP:

python3 -m http.server 8000   # then open http://localhost:8000

The catalogue loads; anything touching auth or avatars won't.

About

Kept as-is rather than modernized. Linked from the archived version of my original portfolio; my current portfolio is here.

About

Exotic Pet Store in Angular

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages