Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit generic arguments #30

Open
AndersMalmgren opened this issue Feb 25, 2016 · 0 comments
Open

Omit generic arguments #30

AndersMalmgren opened this issue Feb 25, 2016 · 0 comments

Comments

@AndersMalmgren
Copy link

Hi.
I finally got time to get wootzjs to build. Very cool.
I'm trying to write a export class for KnockoutJS. This my my code sofar

    [Js(Export = false, Name ="ko")]
    public static class Ko
    {
        [Js(Export = false, Inline ="ko.observable()")]
        public static extern Observable<T> Observable<T>();

        [Js(Export = false, Name = "observable")]
        public static extern Observable<T> Observable<T>(T value);
    }

    public class Observable<T>
    {

    }

doing var foo = Ko.Observable(); will result in javascript var var foo = ko.observable(); thansk to the Inline attribute. But that wont work for the second method becasue it need to pass the argument variable. ommiting the Inline argument and calling var ob2 = Ko.Observable("foo"); will output var ob2 = ko.observable(String, "foo");

This will fail becasue ko.observable wants ko.observable("foo");

Can I somehow omit generic arguments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant