GithubHelp home page GithubHelp logo

rakesh-mohanta / universal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angular/universal

0.0 2.0 0.0 1.8 MB

Universal (isomorphic) javascript support for Angular2

License: MIT License

JavaScript 10.21% TypeScript 88.62% CSS 0.40% HTML 0.77%

universal's Introduction

Build Status npm version Join the chat at https://gitter.im/angular/universal Issue Stats Issue Stats

<img src="https://cloud.githubusercontent.com/assets/1016365/10639063/138338bc-7806-11e5-8057-d34c75f3cafc.png" alt="Universal Angular 2" height="320"/>

Universal Angular 2

Universal (isomorphic) JavaScript support for Angular 2.

Table of Contents

Getting Started

* NodeJS :: Universal Starter repo

* ASP.NET Core :: Universal Starter repo

Modules

Universal

Manage your application lifecycle and serialize changes while on the server to be sent to the client.

Documentation

Design Doc

Videos

Angular 2 Universal Patterns - ng-conf, May 2016
Angular 2 Universal Patterns

Angular Universal Source Code - ReadTheSource, January 2016
Angular Universal Source Code

Full Stack Angular 2 - AngularConnect, Oct 2015
Full Stack Angular 2

Angular 2 Server Rendering - Angular U, July 2015
Angular 2 Server Rendering

preboot.js

Control server-rendered page and transfer state before client-side web app loads to the client-side-app.

Best Practices

When building Universal components in Angular 2 there are a few things to keep in mind.

Note: Universal currently only works with router-deprecated

  • Know the difference between attributes and properties in relation to the DOM.
  • Don't manipulate the nativeElement directly. Use the Renderer. We do this to ensure that in any environment we're able to change our view.
constructor(element: ElementRef, renderer: Renderer) {
  renderer.setElementStyle(element.nativeElement, 'font-size', 'x-large');
}
  • Don't use any of the browser types provided in the global namespace such as navigator or document. Anything outside of Angular will not be detected when serializing your application into html. If you need access to these types please consider using DOM from "angular2/src/platform/dom/dom_adapter"
  • Keep your directives stateless as much as possible. For stateful directives, you may need to provide an attribute that reflects the corresponding property with an initial string value such as url in img tag. For our native <img src=""> element the src attribute is reflected as the src property of the element type HTMLImageElement.

What's in a name?

We believe that using the word "universal" is correct when referring to a JavaScript Application that runs in more environments than the browser. (inspired by Universal JavaScript)

License

MIT License

universal's People

Contributors

adams avatar alfamegaxq avatar alxhub avatar ashsidhu avatar basarat avatar bnjjj avatar dbabaioff avatar fiberjw avatar gitter-badger avatar jeffbcross avatar jeffwhelpley avatar johngorter avatar juristr avatar justindujardin avatar krijger avatar laskoviymishka avatar manekinekko avatar markpieszak avatar naomiblack avatar nathanwalker avatar patrickjs avatar playground avatar quinntynebrown avatar tamascsaba avatar tbosch avatar valorkin avatar vangorden avatar vvakame avatar wesleycho avatar wwtamu avatar

Watchers

 avatar  avatar

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.