I'm using angular beta .8 and I'm using gulp to try and deploy my app to apache http server.
I have a .ts file like this:
import {Component, OnInit} from 'angular2/core';
export class Calendar implements OnInit {
date: any;
ngOnInit() {
$('.datepicker').pickadate({
Which when I try to launch "gulp" command, it shows multiple errors, currently I am trying to solve this ones:
error TS2304: Cannot find name '$'.
I don't know how to provide this for the transpiler and when looking arround I've found two branches of solutions: adding /// <reference path="../node_modules/angular2/typings/browser.d.ts" />
to where I have the bootstrap, which I did, and adding typings which I currently have like this:
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#bc92442c075929849ec41d28ab618892ba493504"
},
"globalDependencies": {
"es6-collections": "registry:dt/es6-collections#0.5.1+20160316155526",
"es6-promise": "registry:dt/es6-promise#0.0.0+20160614011821"
}
}
And it's solved nothing, so I was wondering what else do I need to make this errors go away.
I also have other errors which I am not sure if they are related, mainly it complains about not finding name 'Observable', 'OnInit', a couple .js functions that I make reference in my .ts files, and a few
TS2307 cannot find module 'ng2-material/all'
or different typescript files that it seems it's not finding.
I'd like to mention that code does work if executed on plunker or in the browser, it isn't working when trying to deploy it with gulp.
I've read this thread and applied everything but as I said it isn't working for me Angular 2 typescript can't find names