Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
How to use ngx-bootstrap with angular4 with server side rendering

i have installed ngx-bootstrap and using angular-cli 1.0.1 and done universal setup with the help of Roberto Auler's Post.

I have added path of bootstrap file in angular-cli.json styles

 "styles": [
        "../node_modules/bootstrap/dist/css/bootstrap.min.css",
        "styles.css"
      ],

I am using AlertModule for testing and its throwing error

C:\Users\Praveen\Desktop\Projects\Angular2\universaltest\node_modules\ngx-bootstrap\alert\alert.module.js:1
(function (exports, require, module, __filename, __dirname) { import { CommonModule } from '@angular/common';
                                                              ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Praveen\Desktop\Projects\Angular2\universaltest\dist\ngfactory\src\app\app.server.module.ngfact
ory.ts:17:1)
    at Module._compile (module.js:571:32)
    at Module.m._compile (C:\Users\Praveen\Desktop\Projects\Angular2\universaltest\node_modules\ts-node\src\index.ts:406:23)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .ts] (C:\Users\Praveen\Desktop\Projects\Angular2\universaltest\node_modul
es\ts-node\src\index.ts:409:12)
    at Module.load (module.js:488:32)

Any input will be appreciated.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I sent you a pull request, ts-node does not transpiles the es2015 modules like ngx-bootstrap in node_modules, that's why I used webpack to transpile the code.

https://github.com/ranavc32/SimpleMDE-angular-universal/pull/2/commits/193f4a8c58e01a2b55764532d7e3ca8101d312ec

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda