Open alexzatarain opened 7 years ago
Hi, what version of angular and typescript are you using?
hi , im using angular 2.4 and typescript 2.2 @rodolfocop
Hi, this problem is bound to the way the typescript is being executed. Exclude node_modules from ts compiling Should be fine , it depends of course on what you are using but to be clear plus IDE will be missing functionality To override the typings I would use path mapping :
{ "compilerOptions": { "baseUrl" : "./", "paths": { "*" : ["./node_modules/@types/*", "*"] } } }
Could you put your tsconfig? Can you see here similar problem. (https://github.com/Microsoft/TypeScript/issues/12320)
hi thank you for answering , this is my tsconfig file : { "compilerOptions": { "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2015", "dom" ], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, "outDir": "build" }, "exclude": ["node_module", "./dist", "global.d.ts"] }
as i understand the node_module is already excluded , any hint ? @rodolfocop
/**
Adjust as necessary for your application needs. */ (function (global) { System.config({ baseURL: './', defaultJSExtensions: true, paths: { // paths serve as alias 'npm:': 'build/source/' }, // map tells the System loader where to look for things map: { // our app is within the app folder app: 'build/app',
// angular bundles
'@angular/core': 'npm:angular2/core.umd.js',
'@angular/common': 'npm:angular2/common.umd.js',
'@angular/compiler': 'npm:angular2/compiler.umd.js',
'@angular/platform-browser': 'npm:angular2/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:angular2/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:angular2/http.umd.js',
'@angular/router': 'npm:angular2/router.umd.js',
'@angular/forms': 'npm:angular2/forms.umd.js',
// other libraries
'ng2-pagination': 'node_modules/ng2-pagination/index.js',
'rxjs': 'npm:rxjs',
'moment': 'npm:time/moment.js',
'ng2-bootstrap': 'npm:bootstrap',
'superagent': 'node_modules/superagent/lib',
'component-emitter': 'node_modules/component-emitter/index.js',
'moment/locale/es': 'npm:time/locale/es.js',
'ng2-lazyload-image': 'node_modules/ng2-lazyload-image',
'ng2-page-scroll': 'node_modules/ng2-page-scroll/bundles/ng2-page-scroll.umd.js',
'angular2-google-maps/core': 'node_modules/angular2-google-maps/core',
'ng2-datepicker-bootstrap': 'node_modules/ng2-datepicker-bootstrap'
// 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
format: 'register',
main: 'main',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
'ng2-bootstrap': {
main: 'ng2-bootstrap.min.js',
format: 'cjs',
defaultExtension: 'js'
},
'superagent': {
main: 'client',
defaultExtension: 'js'
},
' ng2-datepicker-bootstrap': {
main: 'index',
defaultExtension: 'js'
},
'ng2-lazyload-image': {
main: 'index',
defaultExtension: 'js'
},
'angular2-material-datepicker': {
main: 'index',
defaultExtension: 'js'
},
'angular2-google-maps/core': {
main: 'index',
defaultExtension: 'js'
}
}
}); })(this);
this is my systemjs.config file too
I think you're having trouble importing the project with system.js.
I'll have to change the design so it can be used this way.
what is the problem? i configured something wrong?
No friend the problem is with my component, it does not work using system.js. It is not enabled to use this way, only as described in the readme. I will have to change for you to use.
hello again @rodolfocop i managed to make it compile but when now i get this errror on the console : Unexpected value 'undefined' imported by the module 'AppModule'↵ Error: Unexpected value 'undefined' imported by the module 'AppModule'↵ (SystemJS) Bootstrap's JavaScript requires jQuery↵ Error: Bootstrap's JavaScript requires jQuery↵
any hints ? thank you !
Hi @alexzatarain , this should be referring to the jquery library that is not being imported by the angular.
In the .angular-cli.json file, add
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],
Of course do not forget to install via NPM
i was getting error where datepicker element was not recognized etc... I don't get this, in your example it says use <datepicker>
but in your selector code is below
@Component({ selector: 'app-datepicker', templateUrl: './datepicker.component.html', providers: [DatePickerValueAccessor], styleUrls: ['./datepicker.component.scss'] })
Hi, @iambastardo I'm sorry, this really is my mistake I did not update my readme.
to use it enough
<app-datepicker [(ngModel)] = "model.firstDate" [viewFormat] = "'DD / MM / YYYY'" [modelFormat] = "'YYYY-MM-DD'" [id] = "'firstDate' [label] = "'To'"> </ app-datepicker>
what it can be ?