1
votes

I'm playing around with Angular2 and I'm trying to flesh out a scala.js shim. It seems that as of the angular2-rc releases, the code is no longer published to https://code.angularjs.org. The last release there is 2.0.0-beta.17. My <head> tag currently has this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.29/system.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/router.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/http.js"></script>

Of course changing the version in the path to any rc version results in a 404.

How can I continue to import angular2 library components via script tags? Will I have to build and publish them myself?

1

1 Answers

1
votes

You can get it from https://npmcdn.com/@angular

  var ngVer = '@2.0.0-rc.4';
  var routerVer = '@3.0.0-beta.1';

'@angular':                   'https://npmcdn.com/@angular', // sufficient if we didn't pin the version
'@angular/router':            'https://npmcdn.com/@angular/router' + routerVer,
'@angular/forms':             'https://npmcdn.com/@angular/forms' + formsVer,
'@angular/router-deprecated': 'https://npmcdn.com/@angular/router-deprecated' + routerDeprecatedVer,
'angular2-in-memory-web-api': 'https://npmcdn.com/angular2-in-memory-web-api', // get latest
'rxjs':                       'https://npmcdn.com/[email protected]',
'ts':                         'https://npmcdn.com/[email protected]/lib/plugin.js',
'typescript':                 'https://npmcdn.com/[email protected]/lib/typescript.js',

Refer this plunker example - https://angular.io/resources/live-examples/quickstart/ts/plnkr.html

See if this helps.