Stuck at PhoneCat Preparation Tutorial

88 views
Skip to first unread message

Derek Lin

unread,
Apr 8, 2016, 2:03:04 AM4/8/16
to AngularJS
I am at just before the Preparing Tests section.

When I start up the server and try to run the app, I get errors (see below).  I have been trying to debug and see the issues.  I see that angular is trying to load an undefined module.  I can't figure out which module is undefined.

Any help is appreciated.  Attached is my example project, without bower_components and node_modules.

system.src.js:121 Uncaught (in promise) Error: Error: [$injector:modulerr] Failed to instantiate module phonecatApp due to:
Error: [$injector:modulerr] Failed to instantiate module undefined due to:
Error: [ng:areq] Argument 'module' is not a function, got undefined
http://errors.angularjs.org/1.4.10/$injector/modulerr?p0=undefined&p1=Error…calhost%3A8000%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3A4381%3A11)
http://errors.angularjs.org/1.4.10/$injector/modulerr?p0=phonecatApp&p1=Err…calhost%3A8000%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3A1704%3A12)
   at System.register.context_1.execute (http://localhost:8000/app/js/app.module.js:41:21)
angular-phonecat-d6.7z

Tito

unread,
Apr 8, 2016, 1:32:41 PM4/8/16
to AngularJS
working nicely for me. what happens when you do 

npm install
bower install

does it finish without any errors?

Tito

unread,
Apr 8, 2016, 1:33:12 PM4/8/16
to AngularJS
another question

how are you spinning things up?


On Thursday, April 7, 2016 at 11:03:04 PM UTC-7, Derek Lin wrote:

Derek Lin

unread,
Apr 8, 2016, 5:52:55 PM4/8/16
to AngularJS
I start up using npm start

You didn't get any error?  Are you using my code base?  That's strange... You didn't change anything right?

Derek Lin

unread,
Apr 8, 2016, 6:04:18 PM4/8/16
to AngularJS
@Tito.  You are right.  It works when I downloaded my own zip and run npm install again. (Although I am using a different computer right now)  I have no idea!  Thanks very much for checking!

Well, someone can use my zip as a base for continuing on the upgrade tutorial :)

Derek Lin

unread,
Apr 10, 2016, 12:48:43 AM4/10/16
to AngularJS
I think I figured out what went wrong.  I used this code as a base for the tutorial:

And it's using PhonecatDetailCtrl as the name instead of PhoneDetailCtrl as in the tutorial. So PhoneDetailCtrl was not exported:

When I do npm run tsc, it actually spells out the problem:
app/js/phone_detail/phone_detail.controller.ts(15,16): error TS2304: Cannot find name 'PhoneDetailCtrl'.


Tito

unread,
Apr 11, 2016, 1:23:28 AM4/11/16
to AngularJS
its good to sometimes take a break. when you have been staring at the same code for hours you get cross eyed and miss the simplest things.
Reply all
Reply to author
Forward
0 new messages