activewidgets / getlibs

OBSOLETE, DO NOT USE: This project is no longer maintained
MIT License
165 stars 12 forks source link

material2 Failed to load resource: the server responded with a status of 404 #9

Open tsarenkotxt opened 6 years ago

tsarenkotxt commented 6 years ago

I downloaded an examples [material2](https://github.com/angular/material2/tree/master/src/demo-app) tried `getlibs, but had exception: [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (theme.css, line 0) [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (main.ts, line 0) [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (index.ts, line 0) [Error] Unhandled Promise Rejection: Error: Fetch error: 404 Not Found Instantiating http://localhost:63342/main/index.ts Loading http://localhost:63342/main.ts Loading ./main.ts (anonymous function) (min.js:2:231) promiseReactionJob

can you help me ?

xkam commented 6 years ago

Sorry, I could not make it work. You have to look at their system.config and apply the relevant mappings. Here is what I have so far -

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="theme.css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
</head>
<body>
  <entry-app>Loading...</entry-app>
<script src="https://unpkg.com/getlibs@0.1.1/dist/min.js"></script>
<script>

System.config({

    typescriptOptions: {
        module: 'commonjs',
        sourceMap: true,
        emitDecoratorMetadata: true,
        experimentalDecorators: true
    },

    packages: {
        '../cdk': {main: 'public-api.ts', defaultExtension: 'ts'},
        '../lib': {main: 'public-api.ts', defaultExtension: 'ts'}
    },

    map: {
        '@angular/common/http': '@angular/common/bundles/common-http.umd.js',
        '@angular/platform-browser/animations': '@angular/platform-browser/bundles/platform-browser-animations.umd.js',
        '@angular/animations/browser': '@angular/animations/bundles/animations-browser.umd.js',
        '@angular/cdk': '../cdk',
        '@angular/material': '../lib',
        '@angular/material-experimental': '../material-experimental',
        '@angular/cdk-experimental': '../cdk-experimental'
    }
});

System.import('./main.ts');
</script>
</body>
</html>