+Josh Haberman <haber...@google.com>

On Thu, Sep 29, 2016 at 11:56 AM sanjith kumar <sanjithkumar...@gmail.com>
wrote:

> Hi Guys. I am new to using protobuf and javascript. I have installed npm
> google-protobuf.
> Following is my .proto file
>
> *syntax = "proto3";
> package com.sixdee;
> message Student{
>         string name = 1;
>         int32 id = 2;
> }*
>
> And this is how i have generated the .js file
>
> *protoc --js_out=import_style=commonjs,binary:. testproto.proto*
>
> i have pasted the resulting testproto_pb.js in my project. I am not able to 
> build a protobuf object. I have tried
>
>
> *var student = new Student();*
>
> *student.setName("Ankith");*
>
> *student.setId(24);*
>
> I get Uncaught ReferenceError: Student is not defined
>
> I have referred link <https://github.com/google/protobuf/tree/master/js>. 
> nothing seems to work for me. Any help is deeply appreciated.
>
>
> Thanks,
>
> Sanjith
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to