Coder Social home page Coder Social logo

rolandjitsu / angular-lab Goto Github PK

View Code? Open in Web Editor NEW
147.0 13.0 30.0 1.28 MB

Angular Lab

Home Page: https://angular-lab.rolandgroza.io

License: MIT License

JavaScript 27.84% HTML 6.23% CSS 10.07% Shell 2.06% TypeScript 53.81%
angular-2 angular angular-2-quickstart material-2 angular-flex-layout firebase sauce-labs travis-ci angular-4

angular-lab's People

Contributors

gitter-badger avatar rolandjitsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-lab's Issues

Does async validation works after update to beta?

Hi guys.
I used your example from here in order to implement dynamic async validaton.
After I've updated my angular to beta I have the next issue:

  1. I created async validation directive (attribute, gets control from arguments);
  2. On document ready this validation runs, but I prevent it execution because the input is untouched yet;
  3. But on input change it doesn't run.

I tried to do it with running validate method using OnChange interface and ngOnChange method - no results.
If I use composeAsync my control.errors is broken because it becomes not a plain JS object as it should be, but the promise.

Please, help.

Here is my directive's code:

import {
  provide,
  Directive,
  OnInit,
  ElementRef,
} from 'angular2/core';
import {
    NG_ASYNC_VALIDATORS,
    Control,
    Validator
} from 'angular2/common';

@Directive({
  selector: '[duration]',
  properties: [
    'notParsedValue: duration',
    'message: durationMsg',
    'control: ngControl'
  ],
  providers: [
    provide(NG_ASYNC_VALIDATORS, {
      useExisting: Duration,
      multi:       true
    })
  ]
})
export class Duration implements Validator, OnInit {
  public notParsedValue: string;
  public message: string = 'File duration is invalid';
  public control: Control;

  // some inner logic here ...

  /**
   *
   * @param control
   * @returns {Promise<T>}
   */
  validate(control: Control): {[key: string]: any} {
    console.log('Duration validator running');
    return new Promise( resolve => {

      if (this._doesInputFilled(this.control) && this._shouldRun()) {
        this._validate(this.control.value).then(resolve, err => {
          this._addError(err);
          resolve(err);
        });
      } else {
        resolve(null);
      }

    });

  };

  /**
   *
   * @param element
   */
  constructor(element:ElementRef) {
    this._element    = element;
    // ...
  }

  /**
   *
   */
  ngOnInit() {
    console.log('Duration directive OnInit', this);
    // ...
  }

}

feat: firebase security rules

Now that we have authentication we need to implement some authorization for our data endpoints using Firebase Security rules. Also, keep then in a rules.json file in the repo so other users can benefit as well.

docs: document Travis CI setup

For users using their own Travis CI, it would be nice to document the steps for setting up the project with Travis, but also using Saucelabs for tests and deployments to Firebase.

feat: use web workers

When web workers are more stable in Angular 2, implement a simple example using web workers. There are many examples out there, including this.

refactor: gulp tasks

Perhaps the current gulp solution for running the unit tests and the app in parallel is not the best one, let's come up with a better one.

feat: prod and dev setups

Figure out a way to have a production and development setup.

Note: Using TS --out bundle.js will concat all compiled code into one file, try using that in combination with gulp.

feat: use Polymer for UI

Until Angular Material will be ported to Angular 2, use Polymer (Material Design Lite does not work well with dynamic websites).

Modify services / chores to not use User

First off, many thanks for putting this project out there. I've learned quite a bit about angular2 and firebase just by looking through the code.

My end goal is to be able to have Chores shared between users. I'm currently looking at services.ts and believe I can do this very simply by removing /${user.key} on line 24. But doing just that seems pretty hack like. If I'm not going to need User then there is probably several lines of code I can remove here. However, my understanding of Angular2 services and also Promises is not so good. Do you have any insight on how this code could be restructured for my needs? Thanks!

fix: SVG renderings

It looks like with the latest alpha update (45), all SVG renderings are broken.

chore: firebase data management

Figure out a good schema to use for the chores/todos in the Firebase backend now that users have been introduced. Also store users and implement logic to handle users that authenticate using different methods but have the same identity.

feat: implement a user account/dashboard

As of right now, the only thing users can do in the account area is change their password. It would be nice to have a few more things and also handle the password for users that have singed up using Google/Github.

feat: get rid of Bower

When I trying to move normalize css and firebase dependency to npm and drop bower, getting below error in browser console. But application is working fine without any other error.

Any idea about this?

Uncaught ReferenceError: module is not defined(anonymous function) @ firebase-web.js:264

fix: change password for unregistered users

If a user used Github or Google for signing up, he/she does not have a password, this changing password would not work. Figure out a good way for the user to set a password in this case instead of changing it.

refactor: restructure Firebase data

It would be a good idea to have a better structure for the data so that it would allow for better and more comprehensive/restrictive security rules. Check Stackoverflow question for more info.

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.