FountainJS / generator-fountain-angular2

Yeoman 'fountain' generator to start a webapp with Angular 2
http://fountainjs.io
MIT License
81 stars 19 forks source link

Cannot read property 'name' of undefined #95

Closed dhamilton1963 closed 7 years ago

dhamilton1963 commented 7 years ago

Prerequisites

Delete the above section and the instructions in the sections below before submitting

Description

Attempting to convert project created by the generator to my needs. I have changed the "template engine" to use PUG. I'm replacing the techs component with my own items component. The items component displays correctly. But when clicking on a item in grid list, I receive the error outlined below "Cannot read property 'name' of undefined". As near as I can tell I have everything setup correctly. I have also attached a zip file of the full project.

Error Message & Stack Trace

ViewWrappedError
_nativeError
:
Error: Error in ./ItemComponent class ItemComponent - inline template:0:56 caused by: Cannot read property 'name' of undefined at ViewWrappedError.BaseError [as constructor] (http://localhost:3000/index.js:4088:34) at ViewWrappedError.WrappedError [as constructor] (http://localhost:3000/index.js:4117:16) at new ViewWrappedError (http://localhost:3000/index.js:33944:16) at _View_ItemComponent0.DebugAppView._rethrowWithContext (http://localhost:3000/index.js:57780:23) at _View_ItemComponent0.DebugAppView.detectChanges (http://localhost:3000/index.js:57766:18) at _View_ItemComponent_Host0.AppView.detectViewChildrenChanges (http://localhost:3000/index.js:57684:19) at _View_ItemComponent_Host0.detectChangesInternal (/ItemModule/ItemComponent/host.ngfactory.js:32:8) at _View_ItemComponent_Host0.AppView.detectChanges (http://localhost:3000/index.js:57658:14) at _View_ItemComponent_Host0.DebugAppView.detectChanges (http://localhost:3000/index.js:57763:44) at ViewRef_.detectChanges (http://localhost:3000/index.js:34554:20) at RouterOutlet.activate (http://localhost:3000/index.js:37637:42) at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/index.js:10036:16) at ActivateRoutes.activateRoutes (http://localhost:3000/index.js:10014:22) at http://localhost:3000/index.js:9976:19 at Array.forEach (native) at ActivateRoutes.activateChildRoutes (http://localhost:3000/index.js:9975:29) at ActivateRoutes.activate (http://localhost:3000/index.js:9970:14) at http://localhost:3000/index.js:9711:56 at SafeSubscriber._next (http://localhost:3000/index.js:179:21) at SafeSubscriber.__tryOrSetError (http://localhost:3000/index.js:471:16) at SafeSubscriber.next (http://localhost:3000/index.js:413:27) at Subscriber._next (http://localhost:3000/index.js:364:26) at Subscriber.next (http://localhost:3000/index.js:328:18) at MergeMapSubscriber.notifyNext (http://localhost:3000/index.js:8323:30) at InnerSubscriber._next (http://localhost:3000/index.js:61480:21) at InnerSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at ReduceSubscriber._complete (http://localhost:3000/index.js:15456:30) at ReduceSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MergeMapSubscriber._complete (http://localhost:3000/index.js:8315:30) at MergeMapSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at ArrayObservable._subscribe (http://localhost:3000/index.js:4959:24) at ArrayObservable.Observable.subscribe (http://localhost:3000/index.js:127:27) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at ReduceOperator.call (http://localhost:3000/index.js:15414:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Object.subscribeToResult (http://localhost:3000/index.js:721:27) at MergeMapSubscriber._innerSub (http://localhost:3000/index.js:8310:38) at MergeMapSubscriber._tryNext (http://localhost:3000/index.js:8307:14) at MergeMapSubscriber._next (http://localhost:3000/index.js:8290:18) at MergeMapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MergeMapSubscriber.notifyNext (http://localhost:3000/index.js:8323:30) at InnerSubscriber._next (http://localhost:3000/index.js:61480:21) at InnerSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at EverySubscriber.notifyComplete (http://localhost:3000/index.js:24663:26) at EverySubscriber._complete (http://localhost:3000/index.js:24680:14) at EverySubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MergeAllSubscriber._complete (http://localhost:3000/index.js:6417:30) at MergeAllSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MapSubscriber.Subscriber._complete (http://localhost:3000/index.js:371:26) at MapSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at ArrayObservable._subscribe (http://localhost:3000/index.js:4959:24) at ArrayObservable.Observable.subscribe (http://localhost:3000/index.js:127:27) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) …MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MergeMapSubscriber.notifyNext (http://localhost:3000/index.js:8323:30) at InnerSubscriber._next (http://localhost:3000/index.js:61480:21) at InnerSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at Object.subscribeToResult (http://localhost:3000/index.js:716:25) at MergeMapSubscriber._innerSub (http://localhost:3000/index.js:8310:38) at MergeMapSubscriber._tryNext (http://localhost:3000/index.js:8307:14) at MergeMapSubscriber._next (http://localhost:3000/index.js:8290:18) at MergeMapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at CatchSubscriber.Subscriber._next (http://localhost:3000/index.js:364:26) at CatchSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at LastSubscriber._complete (http://localhost:3000/index.js:39292:25) at LastSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MergeAllSubscriber._complete (http://localhost:3000/index.js:6417:30) at MergeAllSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at ScalarObservable._subscribe (http://localhost:3000/index.js:24131:28) at ScalarObservable.Observable.subscribe (http://localhost:3000/index.js:127:27) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeAllOperator.call (http://localhost:3000/index.js:6386:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at LastOperator.call (http://localhost:3000/index.js:39221:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at CatchOperator.call (http://localhost:3000/index.js:24184:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at http://localhost:3000/index.js:158:38 at new x (https://cdn.fontawesome.com/js/stats.js:2:25976) at Observable.forEach (http://localhost:3000/index.js:157:16) at http://localhost:3000/index.js:9695:18 at new x (https://cdn.fontawesome.com/js/stats.js:2:25976) at Router.runNavigate (http://localhost:3000/index.js:9660:16) at http://localhost:3000/index.js:9651:67 at u (https://cdn.fontawesome.com/js/stats.js:2:24853) at https://cdn.fontawesome.com/js/stats.js:2:24975 at MutationObserver.a (https://cdn.fontawesome.com/js/stats.js:1:23645) at ZoneDelegate.invoke (http://localhost:3000/index.js:48186:26) at Zone.runGuarded (http://localhost:3000/index.js:48082:47) at MutationObserver.<anonymous> (http://localhost:3000/index.js:48058:29)
context
:
DebugContext
message
:
(...)
name
:
(...)
originalError
:
TypeError: Cannot read property 'name' of undefined at _View_ItemComponent0.detectChangesInternal (/ItemModule/ItemComponent/component.ngfactory.js:80:58) at _View_ItemComponent0.AppView.detectChanges (http://localhost:3000/index.js:57658:14) at _View_ItemComponent0.DebugAppView.detectChanges (http://localhost:3000/index.js:57763:44) at _View_ItemComponent_Host0.AppView.detectViewChildrenChanges (http://localhost:3000/index.js:57684:19) at _View_ItemComponent_Host0.detectChangesInternal (/ItemModule/ItemComponent/host.ngfactory.js:32:8) at _View_ItemComponent_Host0.AppView.detectChanges (http://localhost:3000/index.js:57658:14) at _View_ItemComponent_Host0.DebugAppView.detectChanges (http://localhost:3000/index.js:57763:44) at ViewRef_.detectChanges (http://localhost:3000/index.js:34554:20) at RouterOutlet.activate (http://localhost:3000/index.js:37637:42) at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/index.js:10036:16) at ActivateRoutes.activateRoutes (http://localhost:3000/index.js:10014:22) at http://localhost:3000/index.js:9976:19 at Array.forEach (native) at ActivateRoutes.activateChildRoutes (http://localhost:3000/index.js:9975:29) at ActivateRoutes.activate (http://localhost:3000/index.js:9970:14) at http://localhost:3000/index.js:9711:56 at SafeSubscriber._next (http://localhost:3000/index.js:179:21) at SafeSubscriber.__tryOrSetError (http://localhost:3000/index.js:471:16) at SafeSubscriber.next (http://localhost:3000/index.js:413:27) at Subscriber._next (http://localhost:3000/index.js:364:26) at Subscriber.next (http://localhost:3000/index.js:328:18) at MergeMapSubscriber.notifyNext (http://localhost:3000/index.js:8323:30) at InnerSubscriber._next (http://localhost:3000/index.js:61480:21) at InnerSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at ReduceSubscriber._complete (http://localhost:3000/index.js:15456:30) at ReduceSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MergeMapSubscriber._complete (http://localhost:3000/index.js:8315:30) at MergeMapSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at ArrayObservable._subscribe (http://localhost:3000/index.js:4959:24) at ArrayObservable.Observable.subscribe (http://localhost:3000/index.js:127:27) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at ReduceOperator.call (http://localhost:3000/index.js:15414:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Object.subscribeToResult (http://localhost:3000/index.js:721:27) at MergeMapSubscriber._innerSub (http://localhost:3000/index.js:8310:38) at MergeMapSubscriber._tryNext (http://localhost:3000/index.js:8307:14) at MergeMapSubscriber._next (http://localhost:3000/index.js:8290:18) at MergeMapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MergeMapSubscriber.notifyNext (http://localhost:3000/index.js:8323:30) at InnerSubscriber._next (http://localhost:3000/index.js:61480:21) at InnerSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at EverySubscriber.notifyComplete (http://localhost:3000/index.js:24663:26) at EverySubscriber._complete (http://localhost:3000/index.js:24680:14) at EverySubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MergeAllSubscriber._complete (http://localhost:3000/index.js:6417:30) at MergeAllSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MapSubscriber.Subscriber._complete (http://localhost:3000/index.js:371:26) at MapSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at ArrayObservable._subscribe (http://localhost:3000/index.js:4959:24) at ArrayObservable.Observable.subscribe (http://localhost:3000/index.js:127:27) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeAllOperator.call (http://localhost:3000/index.js:6386:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at EveryOperator.call (http…MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MergeMapSubscriber.notifyNext (http://localhost:3000/index.js:8323:30) at InnerSubscriber._next (http://localhost:3000/index.js:61480:21) at InnerSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at Object.subscribeToResult (http://localhost:3000/index.js:716:25) at MergeMapSubscriber._innerSub (http://localhost:3000/index.js:8310:38) at MergeMapSubscriber._tryNext (http://localhost:3000/index.js:8307:14) at MergeMapSubscriber._next (http://localhost:3000/index.js:8290:18) at MergeMapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at CatchSubscriber.Subscriber._next (http://localhost:3000/index.js:364:26) at CatchSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at MapSubscriber._next (http://localhost:3000/index.js:6313:26) at MapSubscriber.Subscriber.next (http://localhost:3000/index.js:328:18) at LastSubscriber._complete (http://localhost:3000/index.js:39292:25) at LastSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at MergeAllSubscriber._complete (http://localhost:3000/index.js:6417:30) at MergeAllSubscriber.Subscriber.complete (http://localhost:3000/index.js:353:18) at ScalarObservable._subscribe (http://localhost:3000/index.js:24131:28) at ScalarObservable.Observable.subscribe (http://localhost:3000/index.js:127:27) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeAllOperator.call (http://localhost:3000/index.js:6386:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at LastOperator.call (http://localhost:3000/index.js:39221:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at CatchOperator.call (http://localhost:3000/index.js:24184:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MapOperator.call (http://localhost:3000/index.js:6284:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at Observable._subscribe (http://localhost:3000/index.js:185:28) at MergeMapOperator.call (http://localhost:3000/index.js:8265:23) at Observable.subscribe (http://localhost:3000/index.js:124:22) at http://localhost:3000/index.js:158:38 at new x (https://cdn.fontawesome.com/js/stats.js:2:25976) at Observable.forEach (http://localhost:3000/index.js:157:16) at http://localhost:3000/index.js:9695:18 at new x (https://cdn.fontawesome.com/js/stats.js:2:25976) at Router.runNavigate (http://localhost:3000/index.js:9660:16) at http://localhost:3000/index.js:9651:67 at u (https://cdn.fontawesome.com/js/stats.js:2:24853) at https://cdn.fontawesome.com/js/stats.js:2:24975 at MutationObserver.a (https://cdn.fontawesome.com/js/stats.js:1:23645) at ZoneDelegate.invoke (http://localhost:3000/index.js:48186:26) at Zone.runGuarded (http://localhost:3000/index.js:48082:47) at MutationObserver.<anonymous> (http://localhost:3000/index.js:48058:29)
stack
:
(...)
__proto__
:
WrappedError

Config

{ "generator-fountain-angular2": { "version": "1.0.0-rc1", "props": { "resolved": "C:\Users\dhamilton\AppData\Roaming\npm\node_modules\generator-fountain-angular2\generators\app\index.js", "namespace": "fountain-angular2:app", "argv": { "remain": [], "cooked": [], "original": [] }, "framework": "angular2", "modules": "webpack", "css": "scss", "js": "typescript", "ci": [ "travis" ], "sample": "techs", "router": "router" } } }

Relevant Links

Attached zip file. items-test-ui.zip

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and yo. Run the following to get it quickly:

Node.js v6.6.0
win32 6.3.9600

yo 1.8.5
npm 3.10.3
dhamilton1963 commented 7 years ago

Resolved issue by placing "?" after item object in template. Example: {{ item?.name }}