rodolfocop / ng2-datepicker-bootstrap

Datepicker component to Angular2 - Using css to Bootstrap
3 stars 5 forks source link

im getting this issue when i compile #7

Open alexzatarain opened 7 years ago

alexzatarain commented 7 years ago

capture

what it can be ?

rodolfocop commented 7 years ago

Hi, what version of angular and typescript are you using?

alexzatarain commented 7 years ago

hi , im using angular 2.4 and typescript 2.2 @rodolfocop

rodolfocop commented 7 years ago

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)

alexzatarain commented 7 years ago

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

alexzatarain commented 7 years ago

/**

this is my systemjs.config file too

rodolfocop commented 7 years ago

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.

alexzatarain commented 7 years ago

what is the problem? i configured something wrong?

rodolfocop commented 7 years ago

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.

alexzatarain commented 7 years ago

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 !

rodolfocop commented 7 years ago

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

vincentmegia commented 7 years ago

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'] })

rodolfocop commented 7 years ago

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>