tomwayson/angular2-esri-example

Problem in updating to Angular 2 RC5

Closed this issue · 12 comments

Whe I try to update to RC5, maybe the problem from NgModule, the project can not work properly(the Esri/... library can not be found in the project but it has been loaded in the memory)

can you please push a branch (off of current master) w/ the changes you made to update to RC5?

I updated to RC5 and the app is working when I used the solution found here: SOF solution -- had to add ngDefaultControl to the input in layers component. However there is still an issues in the console explaining that we are using "old forms module". Would you like me to do a PR with the update to RC5 and I will take a swing at updating the form in the layers component.

@eddiepantoja very nice, thanks in advance.
@tomwayson I still have problem in it, can we see his solution?

In the mean time I will push current state to my fork.

@eddiepantoja I'd gladly accept a pull request of your changes updating this repo to RC5! Also whatever changes are needed to update the forms module if you can.

Thanks!

I have pushed changes to my fork and will work on forms module.

Cool! it works pretty nice, Thanks a lot. Don't forgot to change "systemjs.config.js" file.

@Shawn-Fan if you had to make changes to systemjs.config.js, and if those changes are not in #23 would you mind posting those changes, either here, or in #23?

@tomwayson , Following is the file (Angular material included):

(function(global) {

// map tells the System loader where to look for things
var map = {
'app': 'app', // 'dist',

'@angular':                   'node_modules/@angular',
'rxjs':                       'node_modules/rxjs'

};

var Materialmap = {
'@angular2-material': 'node_modules/@angular2-material'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: 'boot.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' }
};

// packages tells the System loader how to load when no filename and/or no extension
var materialpackages = {
'@angular2-material/core': {
format: 'cjs',
defaultExtension: 'js',
main: 'core.js'
},
'@angular2-material/card': {
format: 'cjs',
defaultExtension: 'js',
main: 'card.js'
},
'@angular2-material/button': {
format: 'cjs',
defaultExtension: 'js',
main: 'button.js'
}
};
var ngPackageNames = [
'common',
'compiler',
'core',
'forms',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade',
];

var ngMaterialPackageNames = [
'core',
'card',
'button'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}

function MpackIndex(pkgName) {
materialpackages['@angular2-material'+ pkgName] = { main: pkgName + '.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
}

function MpackUmd(pkgName) {
packages['@angular2-material/' + pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
}

// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;

// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);

// No umd for router yet
packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' };

var config = {
map: map,
packages: packages
};
System.config(config);

var setMaterialsPackageConfig = System.packageWithIndex ? MpackIndex : MpackUmd;
// Add package entries for angular packages
ngMaterialPackageNames.forEach(setMaterialsPackageConfig);
var Materialconfig = {
map: Materialmap,
packages: materialpackages
};

System.config(Materialconfig);

})(this);

will you use the "forms" to develop "UI"?

@Shawn-Fan no changes should be needed to systemjs.config.js b/c we're now using webpack. In fact, there's no need for the system.js config file at all (see #24)

Fixed in #23