ngx-card icon indicating copy to clipboard operation
ngx-card copied to clipboard

ngx-card does not work on angular 6.

Open harleenarora opened this issue 7 years ago • 12 comments

Hi,

I have install in my angular 6 application. But its show Two errors.

Uncaught TypeError: Cannot read property 'Directive' of undefined at Object. (ngx-card.umd.js:111) at webpack_require (ngx-card.umd.js:30) at Object. (ngx-card.umd.js:205) at webpack_require (ngx-card.umd.js:30) at Object.idCounter (ngx-card.umd.js:337) at webpack_require (ngx-card.umd.js:30) at module.exports (ngx-card.umd.js:76) at ngx-card.umd.js:79 at webpackUniversalModuleDefinition (ngx-card.umd.js:9) at ngx-card.umd.js:10

And second issue is:-

appComponent.html:13 ERROR ReferenceError: Card is not defined at NgxCard.push../node_modules/ngx-card/card.js.NgxCard.ngAfterViewInit (card.js:41) at callProviderLifecycles (core.js:9567) at callElementProvidersLifecycles (core.js:9541) at callLifecycleHooksChildrenFirst (core.js:9531) at checkAndUpdateView (core.js:10467) at callViewAction (core.js:10699) at execComponentViewsAction (core.js:10641) at checkAndUpdateView (core.js:10464) at callViewAction (core.js:10699) at execEmbeddedViewsAction (core.js:10662)

harleenarora avatar Sep 21 '18 08:09 harleenarora

Same here.

dann95 avatar Dec 21 '18 17:12 dann95

GlobalErrorHandlerService.handleError:  ReferenceError: Card is not defined
    at NgxCard.push../node_modules/ngx-card/card.js.NgxCard.ngAfterViewInit (card.js:41)
    at callProviderLifecycles (core.js:18854)
    at callElementProvidersLifecycles (core.js:18828)
    at callLifecycleHooksChildrenFirst (core.js:18818)
    at checkAndUpdateView (core.js:19754)
    at callViewAction (core.js:19986)
    at execComponentViewsAction (core.js:19928)
    at checkAndUpdateView (core.js:19751)
    at callViewAction (core.js:19986)
    at execComponentViewsAction (core.js:19928)
    at checkAndUpdateView (core.js:19751)
    at callViewAction (core.js:19986)
    at execEmbeddedViewsAction (core.js:19949)
    at checkAndUpdateView (core.js:19746)
    at callViewAction (core.js:19986)
    at execComponentViewsAction (core.js:19928)

dann95 avatar Dec 21 '18 17:12 dann95

Did someone find a fix?

samuelfbtlh avatar Jan 09 '19 17:01 samuelfbtlh

I added in index.html and its works.

=/

kleberksms avatar Jan 11 '19 12:01 kleberksms

I solved the NgxCard.ngAfterViewInit problem with a simple setTimeout, which made me figure out that the real problem was the loading spec

samuelfbtlh avatar Jan 12 '19 17:01 samuelfbtlh

I solved the NgxCard.ngAfterViewInit problem with a simple setTimeout, which made me figure out that the real problem was the loading spec

ok, so that seems to be a problem with "real dom" render vs angular references to dom?

dann95 avatar Jan 14 '19 17:01 dann95

Any chance someone figured out how to fix this? Currently on Angular 8. Thanks

Segfaultd avatar Oct 27 '19 21:10 Segfaultd

Any chance someone figured out how to fix this? Currently on Angular 8. Thanks

I added in index.html its works

pragneshsheela avatar Apr 10 '20 12:04 pragneshsheela

I am on Angular 10. I keep getting the same error as Card not defined I am clueless in finding it out. Can anyone, please explain what's going wrong.

Example Stackblitz: https://stackblitz.com/edit/ngx-card-example-project

I have added the script reference in the index.html and also imported the CardModule, but somehow it still says Card not defined.

connectpritam avatar Jul 22 '20 02:07 connectpritam

After making sure card is installed via npm npm install --save card

In angular.json I added a reference to the node_modules script

....
"architect": {
        "build": {
                ...
                "options": {
                    ...
                    "scripts": [
                        "./node_modules/card/dist/card.js"
                     ]
....

this got rid of that error message for me

p.s. There were two places in the angular.json file for scripts so I added it to both arrays

zatchgordon avatar Oct 07 '20 01:10 zatchgordon

I need help with this error message.

This likely means that the library (ngx-card/ngx-card) which declares CardModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

donalddoe avatar Nov 14 '21 15:11 donalddoe

I am experiencing the same error too. Created a new issue for it https://github.com/ihym/ngx-card/issues/24

SDAdham avatar Sep 04 '22 10:09 SDAdham