Comments (10)
Hello,
may I confirm something: do you use angular.beta6 project with typings or you are doing something else?
at the moment because of this issue you cannot add serializer as a dependency into your typings.json, so you need manually add to your typings.json all ambient dependencies from serializer.ts (this is only es6-shim, and if you are using angular - it means you already have es6-shim in your ambient dependencies and you dont need to do anything)
Did you try to start using library despite the fact that typings install does not install anything new for you?
from class-transformer.
Yes, I'm using the same Angular 2.0.0-beta.6 with typings. I also have es6-shim in my ambient dependencies. The problem is that when I try to import serializer.ts to any file in my project, typescript is throwing an error that serializer.ts can not be found, but serializer.ts directory is present in node modules directory. Any ideas?
from class-transformer.
can you provide a code snippet how do you import it? Also do you use "moduleResolution": "node" in your tsconfig?
from class-transformer.
I was trying to import it as you suggested in readme, but it was throwing an error that can not resolve file. Below is the snippet:
import {serialize} from "serializer.ts";
It started to work when I changed that into:
import {serialize} from 'serializer.ts/serializer';
It's now showing warnings that can not find source files and indeed they are not present in module directory.
from class-transformer.
thats strange, I just created a test project and installed it from scratch - everything looks working. If you can attach or send me your test project I'll take a look on that
from class-transformer.
I am using https://github.com/angularclass/angular2-webpack-starter as a base and would really appreciate if you can take a look on this.
from class-transformer.
sorry that was an error in docs. in readme only "example with angular" had correct example. you should use import {serialize} from "serializer.ts/Serializer";
import {serialize} from 'serializer.ts/serializer';
It's now showing warnings that can not find source files and indeed they are not present in module directory.
maybe its because you have imported serializer.ts/serializer
instead of serializer.ts/Serializer
?
from class-transformer.
It is working fine now, the warnings disappeared spontaneously. For someone who is starting with TypeScript, like me, that might be serious problem. Thanks for help :)
from class-transformer.
yw, dont forget to star a project :D
from class-transformer.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from class-transformer.
Related Issues (20)
- question: how to use exposing method inside a nested object array dto?
- fix: exposeDefaultValues does not work HOT 2
- Renamed property does not exist on type Class HOT 2
- Expose properties with different name using a callback HOT 1
- question: How to expose attr when plain object no define HOT 1
- question: How to ignore Transform decorator when using plainToInstance HOT 2
- question: Getting `ReferenceError: Cannot access 'XXX' before initialization` in class circular dependency with Jest & Typescript HOT 3
- question: Constructors validation seems to break when using plainToInstance HOT 1
- Include @IsOptional values to the body if they are missing with default value HOT 1
- fix: Can't use instanceToPlain with Nitro.js event. HOT 4
- External Values are not stripped. HOT 4
- fix: plainToClass cannot handle URL values HOT 5
- feature: function support of options.discriminator.subTypes HOT 1
- plainToClassFromExist is Deprecated what is the replacement for generics? HOT 2
- Cannot transform string to number HOT 7
- question: Is class-transformer really thought to be used in the backend? HOT 3
- question: Options in @Transform Decorator Do Not Reflect Those Passed to plainToInstance in class-transformer HOT 2
- question: Casting Json to the required datatype HOT 2
- instanceToPlain not working properly using nestjs HOT 3
- Transform decorator in class-transformer does not wait for asynchronous function and returns a Promise instead of the transformed value HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from class-transformer.