antonybudianto / angular-starter

:star: Gulp Angular Starter using TypeScript (Updated to 4.4.3)

Home Page:https://antonybudianto.github.io/angular-starter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

materialize (question)

kelvinsinsua opened this issue · comments

Hi, i installed the project to begin the development with angular2. i wish create a project started with this "template" but i have a problem in systemjs.config.js, i need install agular2-materialize and materialize-css but in systemjs.config.js i have a error when i run npm start or npm run build.

my systemjs.config.js

`/*

  • This config is only used during development and build phase only
  • It will not be available on production

*/

(function(global) {
// ENV
global.ENV = global.ENV || 'development';

// map tells the System loader where to look for things
var map = {
    'app': 'src/tmp/app',
    'test': 'src/tmp/test',
    "materialize-css": "node-modules/materialize-css",
    "materialize": "node_modules/angular2-materialize",
    "angular2-materialize": "node_modules/angular2-materialize"
};

// packages tells the System loader how to load when no filename and/or no extension
var packages = {
    'app': {
        defaultExtension: 'js'
    },
    'test': {
        defaultExtension: 'js'
    },
    'rxjs': {
        defaultExtension: 'js'
    }
};

// List npm packages here
var npmPackages = [
    '@angular',
    'rxjs',
    'lodash',
    'materialize-css',
    'angular2-materialize'
];

// Add package entries for packages that expose barrels using index.js
var packageNames = [
    // App barrels
    'app/shared',

    // 3rd party barrels
    'lodash'
];

// Add package entries for angular packages
var ngPackageNames = [
    'common',
    'compiler',
    'core',
    'forms',
    'http',
    'platform-browser',
    'platform-browser-dynamic',
    'router'
];

npmPackages.forEach(function (pkgName) {
    map[pkgName] = 'node_modules/' + pkgName;
});

packageNames.forEach(function(pkgName) {
    packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
});

ngPackageNames.forEach(function(pkgName) {
    map['@angular/' + pkgName] = 'node_modules/@angular/' + pkgName +
        '/bundles/' + pkgName + '.umd.js';
    map['@angular/' + pkgName+'/testing'] = 'node_modules/@angular/' + pkgName +
    '/bundles/' + pkgName + '-testing.umd.js';
});

var config = {
    map: map,
    packages: packages
};

// filterSystemConfig - index.html's chance to modify config before we register it.
if (global.filterSystemConfig) { global.filterSystemConfig(config); }

System.config(config);

})(this);
`

please if you know the correct config help me.

`import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'materialize-css'; //the error start here
import 'angular2-materialize';

import { AppModule } from './app.module';

declare var ENV: string;

if (ENV === 'production') {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);`