Questions tagged [angular2-universal]

Universal Angular 2: Universal (isomorphic) javascript support for Angular2

angular2-universal
Filter by
Sorted by
Tagged with
3 votes
1 answer
890 views

How to deploy angular 4 universal app to firebase

With the introduction to angular 4 of universal, I can't figure out how to deploy the app successfully to a firebase hosting. I followed the steps here https://github.com/angular/angular-cli/wiki/...
LearnToday's user avatar
  • 2,782
1 vote
1 answer
1k views

angular 4 universal - different component / module for server and browser

So I have a simple wrapper for a jquery plugin, however obviously the wrapper bugs-out on universal because of a lack of browser global objects. Like most jquery plugins, this plugin also What I ...
Ahmed-Anas's user avatar
  • 5,511
0 votes
1 answer
692 views

Angular 2 Universal + Akamai

I want to see if I can create a stack based on both, CDN and also angular 2 universal. So when the user navigate has the CDN to get the assets, and if the user access the first time will have the ...
Ricardo Daniel's user avatar
1 vote
2 answers
2k views

Angular4 Universal Server Side Rendering would return more HTML rendered on request

i'm tryingo to use universal and angular4.. everything works, accessing directly via hash routes as well.. but the problem is the request always shows <body><demo-app></demo-app></...
mariomol's user avatar
  • 677
2 votes
1 answer
3k views

angular2 svgPanZoom, window is not defined, webpack issue?

I would like to implement a zoom feature on my website which has a SVG image displayed. I saw this library github.com/ariutta/svg-pan-zoom which provides the exact features i need, However i can't ...
mwoa's user avatar
  • 713
0 votes
1 answer
3k views

Ngx-translate with Angular Universal

I just upgraded from ng2-translate (v. 5.x.x) to ngx-translate (v. 6.x.x) in my Angular 2 Universal App. Before the upgrade I was using this loader (found here): class TranslateUniversalLoader ...
don's user avatar
  • 4,341
0 votes
0 answers
745 views

Unable to find plugin: videoJsResolutionSwitcher in angular2-universal

In the first implementation, I used angular2 without server rendering for creating a web player with video.js library and it's "videojs-resolution-switcher" plugin. I created a directive for ...
Hamed Hamedi's user avatar
  • 1,511
1 vote
0 answers
188 views

Angular2 Server Side Rendering - Angular 2 Universal Issue

I tried changing my angular2 app to angular2 universal. On that I segregated server and client side module. On doing npm start I am getting the following error. EXCEPTION: The selector "app-root" did ...
Abinaya Thoomatti Sethuraman's user avatar
2 votes
1 answer
358 views

Angular2 forms error when using JavaScriptServices/Universal

I have an Angular2 app that was created using the JavaScriptServices starter. The problem that I am having is that I get a runtime error if I have a form in a component. I am importing both ...
Ben Cameron's user avatar
  • 4,375
5 votes
1 answer
1k views

Angular 2 Universal 404 Not Found redirection

I'm implementing a route guard (CanActivate interface) and I need to redirect to not found page under certain conditions. This can be achieved with the following sentence: if (isNode){ let res : ...
José Millán Medina's user avatar
1 vote
0 answers
169 views

ANGULAR UNIVERSAL not able to render with Angularfire2

Dear Awesome helper community. hereby my first question ever!!! and happy to share it with you. I am developing my web app with angular2 and now I would like to refactor it to Angular Universal. In ...
Javier's user avatar
  • 11
4 votes
1 answer
1k views

Get vaues from ExpressJS in Angular Universal app

I'm building an Angular2 Universal app and I'm integrating ng2-translate. Server side I need to know the language of the user, which I could get from ExpressJS via request.acceptsLanguages() (see ...
don's user avatar
  • 4,341
0 votes
1 answer
266 views

Angular 2 Universal Quickstart - require 'ProvideRouter' not working

I'm trying to set up my project for Angular Universal by using the quickstart But it's not going well, there were a lot of errors trying to install typings: Benjamins-MBP:vepo Ben$ sudo typings ...
BeniaminoBaggins's user avatar
1 vote
1 answer
391 views

angular2 universal is very unstable - [nodemon] app crashed - waiting for file changes before starting

I am finding the starter repo from angular class very very unstable or just on how I am using it. My code works locally hitting the same service as remote yet I get the below I followed the rules ...
Tampa's user avatar
  • 77k
2 votes
1 answer
656 views

How to enable minification in universal-starter?

How to enable minification for angular/universal-starter? Right now the browser loads a 3.4MB index.js file: Is enableProdMode responsible for minification? If yes, universal-starter does have ...
Hongbo Miao's user avatar
  • 47.9k
2 votes
1 answer
6k views

Failed at the [email protected] build script 'webpack'

I am using universal-starter as backbone. When I run npm start, I got the error: npm ERR! Darwin 15.6.0 npm ERR! argv "/Users/hongbo-miao/.nvm/versions/node/v6.3.1/bin/node" "/Users/hongbo-miao/....
Hongbo Miao's user avatar
  • 47.9k
2 votes
0 answers
220 views

Override or opt-out from Angular 2 directive/component compilation

The question considers any environment where components should be compiled on application-wide condition (platform-dependent builds). Thus the solution may borrow mocking techniques from Angular 2 ...
Estus Flask's user avatar
8 votes
3 answers
2k views

How to install Angular2 universal when the docs on the site are outdated?

The maintainers at angular2-universal have not updated their site: Problem 1) typings install node express body-parser serve-static express-serve-static-core mime --ambient typings ERR! deprecated ...
Tampa's user avatar
  • 77k
0 votes
1 answer
972 views

TypeError: str.replace is not a function (Angular 2 Universal)

I am using Angular 2 Universal. I have this line in the html part: <span [hidden]="!error">{{error}}</span> It works perfect on the client side, but is shows this error in the terminal (...
Hongbo Miao's user avatar
  • 47.9k
1 vote
0 answers
97 views

angular2 univesral - WARNING: your application is taking a long time to render the application

I am in dev mode doing simple testing using angular2 universal. I get this message in the logs: WARNING: your application is taking a long time to render the application I concur....jeesh its takes ...
Tampa's user avatar
  • 77k
2 votes
2 answers
4k views

ReferenceError: MouseEvent is not defined

I am trying to use ng2-select in a project which uses angular/universal-starter (TypeScript 2.x) as backbone. (I tried to add ng2-select in an angular-cli generated project, it works well though) ...
Hongbo Miao's user avatar
  • 47.9k
41 votes
15 answers
70k views

localStorage is not defined (Angular Universal)

I am using universal-starter as backbone. When my client starts, it read a token about user info from localStorage. @Injectable() export class UserService { foo() {} bar() {} loadCurrentUser(...
Hongbo Miao's user avatar
  • 47.9k
4 votes
1 answer
4k views

error TS2300: Duplicate identifier 'export='

I am using angular/universal-starter as starter which uses TypeScript 2 and Webpack 2. I added packages bluebird and nodemailer. After adding these packages and related typings: "@types/bluebird": "...
Hongbo Miao's user avatar
  • 47.9k
1 vote
3 answers
7k views

Cannot read config.json correctly (TypeScript, Webpack)

UPDATE: the issue is fixed by this PR Be ware of that the reason that the problem comes out and normal pure JavaScript ways cannot solve it could be because that server.ts is using TypeScript and ...
Hongbo Miao's user avatar
  • 47.9k
1 vote
1 answer
1k views

req.body is empty when when header is { 'Authorization': 'Bearer ' + token }

I am using Angular 2 as front end. I tried to send an Object { test: 'Hi' }. When my http header is like this: let headers = new Headers({ 'Content-Type': 'application/json' }); let options = new ...
Hongbo Miao's user avatar
  • 47.9k
3 votes
1 answer
1k views

Angular2 Universal error Cannot find module '@angular/compiler/src/template_parser' after upgrading to RC5

Am using angular2 ,webpack and angular universal the project builds fine but I get the following error at runtime. Works fine with angular RC4 Error: Cannot find module '@angular/compiler/src/...
kabangi julius's user avatar
17 votes
2 answers
11k views

Left-hand side of assignment expression cannot be a constant or a read-only property

When I use this line on my Express server, it works well in TypeScript 1.x mongoose.Promise = global.Promise; ( The usage of mongoose.Promise = global.Promise; is from the mongoose document ) After ...
Hongbo Miao's user avatar
  • 47.9k
0 votes
1 answer
77 views

Difference between expressEngine and ng2engine

I am using universal-starter. For the file server.ts, when I change import { expressEngine } from 'angular2-universal'; app.engine('.html', expressEngine); to import { ng2engine } from 'angular2-...
Hongbo Miao's user avatar
  • 47.9k
1 vote
0 answers
1k views

Angular 2 Universal: Prerender does not work with templateUrl or styleUrls

I have been using Angular 2 Universal for server-side pre-rendering. But components that have direct html template and reference them via templateUrl do not prerender (only by url. With template: '......
Yury Scherbakov's user avatar
11 votes
2 answers
1k views

Can I run a component method only in the client using Angular2 Universal?

I am writing an angular2 universal app. It has a d3 chart, but I was hoping to only render the d3 chart on the client side (browser) and not try to render it on the server. Is there an interface in ...
Subtubes's user avatar
  • 16.4k
0 votes
1 answer
307 views

Why Angular 2 universal server rendered have angular dynamic attribute?

I try to understand the behaviour of universal server side rendering. I look the https://github.com/angular/universal-starter/tree/angular-connect project. My first understanding was that the server ...
Etienne's user avatar
  • 181
5 votes
0 answers
914 views

angular 2 server rendering with java back-end

I use angular 2 with a java back-end (tomcat). I am trying to implements server-side rendering in my POC. I was wondering if angular universal could help me (on client side). I apologize in advance, I ...
Etienne's user avatar
  • 181
2 votes
0 answers
499 views

Does Angular Universal have to clear the components when the client picks up?

Angular Universal I'm testing out Angular Universal for server side rendering (I love it, I think the guys on the angular universal team did an awesome job bringing server-side rendering to angular). ...
Joe Lloyd's user avatar
  • 21.1k
79 votes
7 answers
160k views

Adding script tags in Angular component template

Angular2 removes <script> tags automatically from templates to stop people using this functionality as a "poor's man" loader. The issue here is that script tags currently have more uses than ...
Ian's user avatar
  • 5,733
-2 votes
2 answers
329 views

Angular2 Universal, where and how to learn?

Angular2 Universal seems to me some kind of black magic, I can't find where I can learn this language from the beginning, neither in the official web site have an introduction to the language, only an ...
Augusto Will's user avatar
3 votes
1 answer
324 views

No Directive annotation found on TodoApp Server Rendering

I'm trying to do server rendering with angular2-universal. I copy paste the example todo app of the official repo https://github.com/angular/universal/tree/master/examples/src/universal/todo into my ...
jaumard's user avatar
  • 8,232
8 votes
0 answers
498 views

How does Angular2 Universal handle ajax calls?

I've been using Angula2 + Universal from the day one they launched it, but today I'm getting confused around how it actually works. In their example , in the server.ts file you will find : app.get( ...
Milad's user avatar
  • 28.1k
4 votes
1 answer
1k views

Angular 2 Universal - Server Side Rendering with stylus and pug template

I am trying to build an app with Angular2, typescript, stylus (for css), and pug (for html templating). But, I can't make it work with Angular2 Universal. The problem is that I'm using ts-node to ...
Edmar Miyake's user avatar
  • 12.3k
3 votes
1 answer
371 views

Do the isomorphic apps implies back and front stand together?

I've been getting into isomorphic applications development with Angular 2 Universal but there is this thing that i cannot get clear in my head. My understanding is that keeping back and front sides ...
jscherman's user avatar
  • 5,999
7 votes
2 answers
6k views

Angular2 reflect-metadata shim is required when using class decorators

I’m trying to use the universal starter example to learn more about server rendering with Angular2, I want to use gulp instead of webpack. The problem is when the server start I have : /Users/...
jaumard's user avatar
  • 8,232