Giter Club home page Giter Club logo

Comments (10)

jkosters avatar jkosters commented on August 18, 2024 1

with @nrwl/[email protected] I was able to generate the library without routing and lazy loading using
ng g lib gridmap --prefix=ngx --parent-module=libs/dashboard/src/lib/dashboard.module.ts --tags=child-module

from ngx-starter-kit.

xmlking avatar xmlking commented on August 18, 2024

In a forked repo, I copied "libs/grid" to "libs/gridmap"
and replaced "account" with "vehicle".

you cannot just copy a module. Create gridmap lib module and copy/generate required controllers and/or services.

ng g lib gridmap           --routing --lazy --prefix=ngx --parent-module=libs/dashboard/src/lib/dashboard.module.ts   --tags=child-module

you can see examples for modules/code generation in palybook

from ngx-starter-kit.

SmartParks avatar SmartParks commented on August 18, 2024

Running that command returns this error:
Unexpected token } in JSON at position 2584

How would I determine what file and line has the extra }?
I've installed the Redux DevTools extension.

from ngx-starter-kit.

xmlking avatar xmlking commented on August 18, 2024

Fix is on the way. We need to downgrade angular cli to stable version

from ngx-starter-kit.

xmlking avatar xmlking commented on August 18, 2024

get the latest code. This should fix it.

from ngx-starter-kit.

localsite avatar localsite commented on August 18, 2024

Thanks, the command runs without error. (But no results are returned, and I could not find gridmap in the code after running.)

Where would I define the new module to avoid this error:

VM2379:37 ERROR Error: Uncaught (in promise): Error: Cannot find module "@ngx-starter-kit/gridmap".
Error: Cannot find module "@ngx-starter-kit/gridmap".
at $_lazy_route_resource lazy namespace object:46
at ZoneDelegate.push.../../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:3825)
at ZoneDelegate.push.../../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push.../../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)

Also, a lot of errors are occurring because socket.io is looking for port 3000.

Here's the fork where the errors are occurring. I ran the command both before and after copying the gridmap folder into the repo:
https://github.com/DataPortal/coord-angular

from ngx-starter-kit.

xmlking avatar xmlking commented on August 18, 2024

Noticed same issue.
nx team is updating the version to make it compatible with angular 6.1.0
nrwl/nx#645
we may have to wait or manually create module.

Manual module creation:

  1. copy module e.g., libs/grid as libs\gridmap
  2. do any module, controller, service class name changes as needed.
  3. add gridmap reference in apps/webapp/tsconfig.app.json
  4. add gridmap reference in apps/webapp-e2e/tsconfig.e2e.json
  5. add gridmap reference in nx.json

Reference: https://nrwl.io/nx/guide-nx-workspace

from ngx-starter-kit.

localsite avatar localsite commented on August 18, 2024

Getting very close. Remaining error:

Could not resolve module @ngx-starter-kit/gridmap relative to /Library/Sites/coord-angular/libs/dashboard/src/lib/dashboard.module.ts
Failed to compile.

https://github.com/DataPortal/coord-angular/blob/master/libs/gridmap/src/lib/gridmap.module.ts

Removing the following allows the site to compile:

  { path: '', redirectTo: 'crud-table', pathMatch: 'full', data: { animation: 'gridmap' } },
  { path: 'crud-table', component: VehiclesTableComponent, data: { animation: 'vehicles-table' },
    children: [
      { path: ':id', component: VehicleDetailComponent, data: { animation: 'vehicle-detail' } },
    ],
  },

How would I alter the lines above to get the side navigation working?

from ngx-starter-kit.

xmlking avatar xmlking commented on August 18, 2024

you also need to add gridmap reference to tsconfig.json and gridmap block to angular.json
as shown in the diff below. luckily all of those steps are taken care by nx CLI. we have to wait for nx 6.2 release.

https://github.com/CrossBusiness/coord-angular/commit/dd3f060e4e6e4cc81980a4ed44c54553557708ae

send you PR to make it easy for you to pull changes.

At this point you also need to fix code specific you business requirements.

from ngx-starter-kit.

xmlking avatar xmlking commented on August 18, 2024

with latest code, you should be able to generate lazy routing modules. please test and report any issues.
we have to lock typescript version to 2.7.2 until this issue resolved.
nrwl/nx#684

from ngx-starter-kit.

Related Issues (20)

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.