代码之家  ›  专栏  ›  技术社区  ›  Alexander Presber

CDN的角度2[重复]

  •  0
  • Alexander Presber  · 技术社区  · 6 年前

    我一直试图从angular 2下载源代码,但找不到。我查看了他们的github存储库,但找不到正确的存储库。有人能给我指一个或一个正在工作的CDN以便我下载它吗?

    编辑:我需要在不使用Node.Js和NPM的情况下获取源代码。

    0 回复  |  直到 7 年前
        1
  •  13
  •   yurzui    7 年前

    您可以使用unpkg.com:

    https://unpkg.com/@angular/core@4.0.1/bundles/core.umd.js

    https://unpkg.com/@angular/platform-browser-dynamic@4.0.1/bundles/platform-browser-dynamic.umd.js

    等等

    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 { }
    

    Plunker Example Angular es5