OK I found at least one solution.

The data must be in a global (I called my g_appdata) and not passed as 
input.

In the Typescrip program outside of the class you need 
declare var g_appdata: any;

Then in the ngOnInit (maybe in the constructor rather than the init but I 
put it in the init)
    this.appdata = g_appdata;

and the def for appdata is not an Input().

Hope this helps someone else.

By the way I needed this to keep the server from being statefull. The only 
thing that knows some of the
key data is the request that returns the "index.html" for the app, it can't 
be in a different URL because
the data (the original URL that was requested) is only know to the process 
that is returning the index.html.




On Friday, May 6, 2016 at 8:16:12 AM UTC-4, Philip Dalrymple wrote:
>
>  I am new to Angular and am working with angular2.
>
> I have an object that is in the index.html (generated by my server on the 
> fly) that I need to get into the main app.
>
> what I have now is
>
> var appdata = {
>    "sess" : "29",
>    "error" : "",
>    "cmd" : "home",
>    "collection" : "foobar",
>    "uid" : "pwd",
>    "fullpath" : "/home/",
>    "path" : "",export class Home {
>         isloading = true;
>         sdata;
>         @Input() appdata = {};
>    "colname" : "Early Development System"
>    };
>
> Inside of a <script></script> in the index.html and
>
>
> <home [appdata]="appdata">
>
> inside of the body. in the app itself I have
>
> export class Home {
>         isloading = true;
>         sdata;
>         @Input() appdata = {};
> ....
>
> but when I do a console.log of the appdata It is empty.
> Within components I have used @Input without problem so I 
> think that I understand how to use it.
>
> thanks.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to