Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find the Angular 2 CDN or source code?

Tags:

angular

I've been trying to download the source code from angular 2, but I was unable to find it. I looked in their github repository, but couldn't identify the correct one. Can someone point me the one or a working CDN so I can download it?

Edit: I need to get the source without using Node.Js and NPM.

like image 312
Guilherme Avatar asked Mar 30 '17 20:03

Guilherme


People also ask

Which language can be used to write angular 2 code?

Angular 2 itself is built using TypeScript.

Is angular 2 JavaScript or TypeScript?

It is, however, worth noting that Angular 2 fully supports the use of TypeScript instead of restricting users to plain JavaScript. TypeScript is a programming language that's a superset of JavaScript.


1 Answers

You can use unpkg.com:

https://unpkg.com/@angular/[email protected]/bundles/core.umd.js

https://unpkg.com/@angular/[email protected]/bundles/platform-browser-dynamic.umd.js

and so on.

Here is jsFiddle Example

let { Component, NgModule } = ng.core;

@Component({
  selector: 'my-app',
  template: `
    <h1>Hello, {{ name }}</h1>
    <button (click)="increment()">Click {{ counter }}</button>
  `,
})
class HomeComponent {
    counter = 0;
    name = 'Angular 2'

    increment() {
        this.counter++;
    }
}

const { BrowserModule } = ng.platformBrowser;

@NgModule({
  imports:      [ BrowserModule ],
  declarations: [ HomeComponent ],
  bootstrap:    [ HomeComponent ]
})
class AppModule { }

If you don't want to use typescript then here is

Plunker Example Angular es5

like image 153
yurzui Avatar answered Sep 28 '22 06:09

yurzui