Topic: Angular Universal with mdboostrap NOT Working
faroooq.in pro asked 6 years ago
Damian Gemza staff answered 6 years ago
Damian Gemza staff answered 6 years ago
faroooq.in pro commented 6 years ago
ng add @ng-toolkit/serverless is not working with the universal tutorial provided by mdbootstrap.com. I mean with above link you shared. Please helpDamian Gemza staff commented 6 years ago
Dear Reachfrq, As I said before, you have to add the below code to the server.ts file, and everything will be okay: const DIST_FOLDER = join(process.cwd(), 'dist'); import { readFileSync } from 'fs'; const domino = require('domino'); const template = readFileSync(join(DIST_FOLDER, '/browser/index.html')).toString(); const win = domino.createWindow(template); global['window'] = win; global['Node'] = win.Node; global['navigator'] = win.navigator; global['Event'] = win.Event; global['Event']['prototype'] = win.Event.prototype; global['document'] = win.document; Best Regards, DamianFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 6.2.3
- Device: No
- Browser: Chrome
- OS: windows
- Provided sample code: No
- Provided link: No
faroooq.in pro commented 6 years ago
Thank you. But serverless deployment (ng add @ng-toolkit/serverless ) not working with mdbootstrap universal. I mean the link that you provided. Please help.