Git Product home page Git Product logo

angular-pro-app-seed's People

Contributors

toddmotto 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-pro-app-seed's Issues

AoT: Can't resolve ngfactory

Getting some odd errors when trying to run yarn build:production:

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './../ngfactory/src/app/app.module.ngfactory' in 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\s
rc'
 @ ./src/main.ts 3:0-81
 @ multi zone.js/dist/zone ./src/main.ts

ERROR in ./ngfactory lazy
Module not found: Error: Can't resolve 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory\src\auth\login\login.module.ngfactory.ts
' in 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory'
 @ ./ngfactory lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi zone.js/dist/zone ./src/main.ts

ERROR in ./ngfactory lazy
Module not found: Error: Can't resolve 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory\src\auth\register\register.module.ngfact
ory.ts' in 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory'
 @ ./ngfactory lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi zone.js/dist/zone ./src/main.ts

ERROR in ./ngfactory lazy
Module not found: Error: Can't resolve 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory\src\health\schedule\schedule.module.ngfa
ctory.ts' in 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory'
 @ ./ngfactory lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi zone.js/dist/zone ./src/main.ts

ERROR in ./ngfactory lazy
Module not found: Error: Can't resolve 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory\src\health\meals\meals.module.ngfactory.
ts' in 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory'
 @ ./ngfactory lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi zone.js/dist/zone ./src/main.ts

ERROR in ./ngfactory lazy
Module not found: Error: Can't resolve 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory\src\health\workouts\workouts.module.ngfa
ctory.ts' in 'C:\Users\Mark\Documents\GitHub\angular-pro-app-seed\ngfactory'
 @ ./ngfactory lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi zone.js/dist/zone ./src/main.ts

The build does appear to complete, but then gives me some more errors:

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `cross-env NODE_ENV=production webpack -p`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mark\AppData\Roaming\npm-cache\_logs\2017-08-11T19_52_49_924Z-debug.log

I tried this with my master branch that I've been coding along with your videos, then jumped to the last branch (25 firebase) and got the same errors.

ng build error

Upon npm start or ng build , here is the error.
The build command requires to be run in an Angular project, but a project definition could not be found.

yarn install error

I downloaded code from master branch and when I run yarn install I am getting following error.

PS C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase> yarn install
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "webpack@^1.1.0 || ^2 || ^2.1.0-beta.0 || ^2.2.0-rc.0".
warning " > [email protected]" has incorrect peer dependency "webpack@^2.2.0".
[4/4] Building fresh packages...
[-/2] โ „ waiting...
error C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\Program Files\nodejs\node.exe',
gyp verb cli 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:89:16
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:165:21)
gyp verb which failed python2 Error: not found: python2
gyp verb which failed at getNotFoundError (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:89:16
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:165:21) {
gyp verb which failed stack: 'Error: not found: python2\n at getNotFoundError ' +
gyp verb which failed '(C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:13:12)\n' +
gyp verb which failed ' at F ' +
gyp verb which failed '(C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:68:19)\n' +
gyp verb which failed ' at E ' +
gyp verb which failed '(C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:80:29)\n' +
gyp verb which failed ' at ' +
gyp verb which failed 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:89:16\n' +
gyp verb which failed ' at ' +
gyp verb which failed 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\index.js:42:5\n' +
gyp verb which failed ' at ' +
gyp verb which failed 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\windows.js:36:5\n' +
gyp verb which failed ' at FSReqCallback.oncomplete (fs.js:165:21)',
gyp verb which failed code: 'ENOENT'
gyp verb which failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb which failed Error: not found: python
gyp verb which failed at getNotFoundError (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:89:16
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:165:21)
gyp verb which failed python Error: not found: python
gyp verb which failed at getNotFoundError (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:89:16
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqCallback.oncomplete (fs.js:165:21) {
gyp verb which failed stack: 'Error: not found: python\n at getNotFoundError ' +
gyp verb which failed '(C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:13:12)\n' +
gyp verb which failed ' at F ' +
gyp verb which failed '(C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:68:19)\n' +
gyp verb which failed ' at E ' +
gyp verb which failed '(C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:80:29)\n' +
gyp verb which failed ' at ' +
gyp verb which failed 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\which\which.js:89:16\n' +
gyp verb which failed ' at ' +
gyp verb which failed 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\index.js:42:5\n' +
gyp verb which failed ' at ' +
gyp verb which failed 'C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\isexe\windows.js:36:5\n' +
gyp verb which failed ' at FSReqCallback.oncomplete (fs.js:165:21)',
gyp verb which failed code: 'ENOENT'
gyp verb which failed }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder. (C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:165:21)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Pramod\Dev\ng\angular-pro-app-seed-01-firebase\node_modules\node-sass
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1

Unable to retrieve $key from schedule section

Hi, I'm getting back undefined when trying to retrieve the key for a section in schedule.service.ts. I'm on angular 7+ and rxjs 6+.

This snippet is the problem. I'm always getting id = undefined leading to that I am always going to createSection.

items$ = this.itemList$.pipe(
withLatestFrom(this.section$),
map(([items, section]: any[]) => {

  const id = section.data.$key;

  const defaults: ScheduleItem = {
    workouts: null,
    meals: null,
    section: section.section,
    timestamp: new Date(section.day).getTime()
  };

  const payload = {
    ...(id ? section.data : defaults),
    ...items
  };

  console.log(id);
  if (id) {
    console.log('updateSection');
    return this.updateSection(id, payload);
  } else {
    console.log('createSection');
    return this.createSection(payload);
  }
})

);

uid of previous logged in user is kept when accessing AngularFireDatabase

Hey Todd!

Awesome job on your course! Still enjoying watching!

It got me motivated to build something similar, where I found a small issue;
Whenever I log in, the AuthService has;
get user() { return this.af.auth.currentUser; }

But it returns just an Object, After logging into another account, the AuthService (as it is singular) doesn't update this .currentUser property. It keeps track of my previous account.

In MealsService (also singular);
meals$: Observable<Meal[]> = this.db.list(meals/${this.uid}`)

get uid() {
console.log(this.authService.user.uid)
return this.authService.user.uid; // still returns old UID
}
`

There will be an exception that the newly logged in user is not permitted to access the firebase.db.list.

Suggested solution;
In the constructor of the MealsService, listen to the 'authState' object of the AuthService as this returns an Observable<fb.user>. Let me know what you think and if you have a similar issue.

Retrieving currentUser and uid

Hi @toddmotto,

Thanks for a wonderful course, appreciate your effort. I am trying to follow along in the course and I am at Step 9: MealsService, Reactive Store and Firebase Observables using Angular v11, Firebase v8, Angular Fire v6.1.5 unfortunately this.af.auth.currentUser is not available. The way I can get the current user is via this.af.user but it returns an Observable<firebase.User>.

What do you suggest, should I create a property user in the AuthService and update it using do/tap on authState change or do you have something else in mind?

Node and Firebase

What version of the node and Firebase-tools you are using, is not running the final project because I am in a version far ahead.

Angular 8 upgrade

Expected Behaviour:

To download the pro starter and be able to use the lastest Angular (8)

Actual Behaviour:

Downloading the starter kit is on Angular 4 and requires a significant upgrade.

Schedule state remains the same when changing date

Angular 7+ , Rxjs 6+

Basically title.
I have a schedule for the current date, but when changing to any other date, regardless of week, that schedule continues showing. Anyone had the same issue? Any tips?

edit:
getSchedule() was poorly written.
Should be
return this.db
.list(schedule/${this.uid}, ref => {
return ref
.orderByChild('timestamp')
.startAt(startAt)
.endAt(endAt);
})
.valueChanges();

meals$ observable type error

Hey Todd,

In MealsService defining meals$ at line 22 I'm having a type error:

meals$: Observable<Meal[]> = this.db.list(meals/${this.uid})
.do(next => this.store.set('meals', next));

Type 'Observable<{}>' is not assignable to type 'Observable<Meal[]>'.
Type '{}' is not assignable to type 'Meal[]'.
Property 'includes' is missing in type '{}'.

which should not be there according to AngularFireDatabase.list definition

(method) AngularFireDatabase.list(pathOrRef: PathReference, opts?: FirebaseListFactoryOpts): FirebaseListObservable<any[]>

Any help?

angular-pro-app-seed/src/health/shared/services/meals/meals.service.ts
Branch: 09-meals-component
node 8
Windows 10

screen shot 2018-03-06 at 10 02 06 am
screen shot 2018-03-06 at 10 14 12 am

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.