Skip to content
just working on a fun project
HTML JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
app_uncompiled
.babelrc
.gitignore
Gruntfile.js
README.md
bower.json
database.rules.json
mock-avengers-pet-food.json
package-lock.json
package.json

README.md

The primary components to this app (ctrl-f to find main sections):

  • _Babel=
  • _AngularJS=
  • _Material_Design=
  • _Firebase=

_BABEL= To install Babel correctly via the Babel CLI

$ npm install --save-dev @babel/core @babel/cli @babel/preset-env

Then create a .babelrc with { "presets": ["@babel/preset-env"] } and add "scripts": { "build": "babel app -d app" } to the package.json. IMPORTANT: copy and paste the app folder to save an uncompiled version of the app BEFORE compiling it (i.e. $npm run build) because it's a lot easier to work with human written code than compiler output code


The originally forked AngularJS repo is ideaguy3d/generator-angular


Build & development

Run grunt for building and grunt serve for preview.

Testing

Running grunt test will run the unit tests with karma.

_AngularJS= Yo generator Build Status Gitter

Yeoman generator for AngularJS - lets you quickly set up a project with sensible defaults and best practices.

There are many starting points for building a new Angular single page app, in addition to this one. You can find other options in this list at Yeoman.io.

Roadmap for upcoming plans/features/fixes

Usage

For step-by-step instructions on using Yeoman and this generator to build a TODO AngularJS application from scratch see this tutorial.

Install yo, grunt-cli, bower, generator-angular and generator-karma:

npm install -g grunt-cli bower yo generator-karma generator-angular

If you are planning on using Sass, you will need to first install Ruby and Compass:

  • Install Ruby by downloading from here or use Homebrew
  • Install the compass gem:
gem install compass

Make a new directory, and cd into it:

mkdir my-new-project && cd $_

Run yo angular, optionally passing an app name:

yo angular [app-name]

Run grunt for building and grunt serve for preview

Generators

Available generators:

App

Sets up a new AngularJS app, generating all the boilerplate you need to get started. The app generator also optionally installs Bootstrap and additional AngularJS modules, such as angular-resource (installed by default).

Example:

yo angular

Route

Generates a controller and view, and configures a route in app/scripts/app.js connecting them.

Example:

yo angular:route myroute

Produces app/scripts/controllers/myroute.js:

angular.module('myMod').controller('MyrouteCtrl', function ($scope) {
  // ...
});

Produces app/views/myroute.html:

<p>This is the myroute view</p>

Explicitly provide route URI

Example:

yo angular:route myRoute --uri=my/route

Produces controller and view as above and adds a route to app/scripts/app.js with URI my/route

Controller

Generates a controller in app/scripts/controllers.

Example:

yo angular:controller user

Produces app/scripts/controllers/user.js:

angular.module('myMod').controller('UserCtrl', function ($scope) {
  // ...
});

Directive

Generates a directive in app/scripts/directives.

Example:

yo angular:directive myDirective

Produces app/scripts/directives/myDirective.js:

angular.module('myMod').directive('myDirective', function () {
  return {
    template: '<div></div>',
    restrict: 'E',
    link: function postLink(scope, element, attrs) {
      element.text('this is the myDirective directive');
    }
  };
});

Filter

Generates a filter in app/scripts/filters.

Example:

yo angular:filter myFilter

Produces app/scripts/filters/myFilter.js:

angular.module('myMod').filter('myFilter', function () {
  return function (input) {
    return 'myFilter filter:' + input;
  };
});

View

Generates an HTML view file in app/views.

Example:

yo angular:view user

Produces app/views/user.html:

<p>This is the user view</p>

Service

Generates an AngularJS service.

Example:

yo angular:service myService

Produces app/scripts/services/myService.js:

angular.module('myMod').service('myService', function () {
  // ...
});

You can also do yo angular:factory, yo angular:provider, yo angular:value, and yo angular:constant for other types of services.

Decorator

Generates an AngularJS service decorator.

Example:

yo angular:decorator serviceName

Produces app/scripts/decorators/serviceNameDecorator.js:

angular.module('myMod').config(function ($provide) {
    $provide.decorator('serviceName', function ($delegate) {
      // ...
      return $delegate;
    });
  });

Options

In general, these options can be applied to any generator, though they only affect generators that produce scripts.

CoffeeScript and TypeScript

For generators that output scripts, the --coffee option will output CoffeeScript instead of JavaScript, and --typescript will output TypeScript instead of JavaScript.

For example:

yo angular:controller user --coffee

Produces app/scripts/controller/user.coffee:

angular.module('myMod')
  .controller 'UserCtrl', ($scope) ->

For example:

yo angular:controller user --typescript

Produces app/scripts/controller/user.ts:

/// <reference path="../app.ts" />

'use strict';

module demoApp {
    export interface IUserScope extends ng.IScope {
        awesomeThings: any[];
    }
    
    export class UserCtrl {

        constructor (private $scope:IUserScope) {
	        $scope.awesomeThings = [
              'HTML5 Boilerplate',
              'AngularJS',
              'Karma'
            ];
        }
    }
}

angular.module('demoApp')
  .controller('UserCtrl', demoApp.UserCtrl);

Minification Safe

tl;dr: You don't need to write annotated code as the build step will handle it for you.

By default, generators produce unannotated code. Without annotations, AngularJS's DI system will break when minified. Typically, these annotations that make minification safe are added automatically at build-time, after application files are concatenated, but before they are minified. The annotations are important because minified code will rename variables, making it impossible for AngularJS to infer module names based solely on function parameters.

The recommended build process uses ng-annotate, a tool that automatically adds these annotations. However, if you'd rather not use it, you have to add these annotations manually yourself. Why would you do that though? If you find a bug in the annotated code, please file an issue at ng-annotate.

Add to Index

By default, new scripts are added to the index.html file. However, this may not always be suitable. Some use cases:

  • Manually added to the file
  • Auto-added by a 3rd party plugin
  • Using this generator as a subgenerator

To skip adding them to the index, pass in the skip-add argument:

yo angular:service serviceName --skip-add

Bower Components

The following packages are always installed by the app generator:

  • angular
  • angular-mocks

The following additional modules are available as components on bower, and installable via bower install:

  • angular-animate
  • angular-aria
  • angular-cookies
  • angular-messages
  • angular-resource
  • angular-sanitize

All of these can be updated with bower update as new versions of AngularJS are released.

json3 and es5-shim have been removed as Angular 1.3 has dropped IE8 support and that is the last version that needed these shims. If you still require these, you can include them with: bower install --save json3 es5-shim. wiredep should add them to your index.html file but if not you can manually add them.

Configuration

Yeoman generated projects can be further tweaked according to your needs by modifying project files appropriately.

Output

You can change the app directory by adding an appPath property to bower.json. For instance, if you wanted to easily integrate with Express.js, you could add the following:

{
  "name": "yo-test",
  "version": "0.0.0",
  ...
  "appPath": "public"
}

This will cause Yeoman-generated client-side files to be placed in public.

Note that you can also achieve the same results by adding an --appPath option when starting generator:

yo angular [app-name] --appPath=public

Testing

Running grunt test will run the unit tests with karma.

Contribute

See the contributing docs

When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.

When submitting a PR, make sure that the commit messages match the AngularJS conventions.

When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.

When submitting a new feature, add tests that cover the feature.

Changelog

Recent changes can be viewed on Github on the Releases Page

Sponsors

Love Yeoman work and community? Help us keep it alive by donating funds to cover project expenses!
[Become a sponsor]

License

BSD license

_Material_Design=

What is the UX?

Below is a snapshot of the App with the Users' master-detail view. Also shown is the user experience that will be displayed for smaller device sizes. The responsive layout changes to hide the user list, reveal the menu button. In the User Details view, you may also click the share button to show the Contact <User> bottom sheet view.


material-starter-ux2

Wireframe


This app demonstrates how:

  • Angular Material layout and flex options can easily configure HTML containers
  • Angular Material components <md-toolbar>, <md-sidenav>, <md-icon> can be quickly used
  • Custom controllers can use and show <md-bottomsheet> with HTML templates
  • Custom controller can easily, programmatically open & close the SideNav component.
  • Responsive breakpoints and $mdMedia are used
  • Theming can be altered/configured using $mdThemingProvider
  • ARIA features are supported by Angular Material and warnings can be used to improve accessibility.

The application architecture completely seperates the front end app from the server side app

Install Dependencies

We have two kinds of dependencies in this project: tools and AngularJS framework code. The tools help us manage and test the application.

  • We get the tools we depend upon via npm, the node package manager.
  • We also get the AngularJS and Angular Material library code via npm
npm install

You should find that you have one new folder in your project:

  • node_modules - contains the npm packages for the tools we need

Directory Layout

app/                    --> all of the source files for the application
  assets/app.css        --> default stylesheet
  src/                  --> all app specific modules
     users/             --> package for user features
  index.html            --> app layout file (the main html template file of the app)

Serving the Application Files

While AngularJS is client-side-only technology and it is possible to create AngularJS web apps that don't require a backend server at all, we recommend serving the project files using a local web server during development to avoid issues with security restrictions (sandbox) in browsers. The sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr, etc to function properly when an html page is opened via the file:// scheme instead of http://.

Running the App during Development

The angular-material project comes pre-configured with a local development web server. It is a node.js tool called live-server.

You can run the following command to start the server:

 node ./node_modules/live-server/live-server.js . --open=app

This should open your browser to http://localhost:8080/app/ so you can view the Material-Start app.

You can install also live-server globally to make life easier and for use with other applications:

npm install -g live-server

Then you can start your own development web server to serve static files from a folder by running:

cd my-project
live-server .

Finally, you can choose to configure your a different webserver, such as apache or nginx. Just configure your server to serve the files under the app/ directory.

Updating Angular

Previously we recommended that you merge in changes to angular-seed into your own fork of the project. Now that the AngularJS framework library code and tools are acquired through package managers (npm) you can use these tools instead to update the dependencies.

You can update the tool dependencies by running:

npm update

This will find the latest versions that match the version ranges specified in the package.json file.

Contact

For more information on AngularJS please check out http://angularjs.org/

For more information on Angular Material, check out https://material.angularjs.org/


_Firebase=

AngularFire Build Status Coverage Status Version

AngularFire is the officially supported AngularJS binding for Firebase. Firebase is a backend service that provides data storage, file storage, authentication, and static website hosting for your Angular app.

AngularFire is a complement to the core Firebase client. It provides you with several Angular services:

  • $firebaseObject - synchronized objects
  • $firebaseArray - synchronized collections
  • $firebaseStorage - store and retrieve user-generated content like images, audio, and video
  • $firebaseAuth - authentication, user management, routing

Join our Firebase Google Group to ask questions, provide feedback, and share apps you've built with AngularFire.

Looking for Angular 2 support? Visit the AngularFire2 project.

Table of Contents

Getting Started With Firebase

AngularFire requires Firebase in order to authenticate users and sync and store data. Firebase is a suite of integrated products designed to help you develop your app, grow your user base, and earn money. You can sign up here for a free account.

Downloading AngularFire

In order to use AngularFire in your project, you need to include the following files in your HTML:

<!-- AngularJS -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>

<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/3.6.6/firebase.js"></script>

<!-- AngularFire -->
<script src="https://cdn.firebase.com/libs/angularfire/2.3.0/angularfire.min.js"></script>

You can also install AngularFire via npm and Bower and its dependencies will be downloaded automatically:

$ npm install angularfire --save
$ bower install angularfire --save

Documentation

Examples

Full Examples

Recipes

Migration Guides

Contributing

If you'd like to contribute to AngularFire, please first read through our contribution guidelines. Local setup instructions are available here.

You can’t perform that action at this time.