These are chat archives for AlexSerrano22/testofcodeblock

5th
Apr 2016
AlexSerrano22
@AlexSerrano22
Apr 05 2016 17:36
blockquote xd
    > blockquote sd> blockquote
test
import {bootstrap} from "angular2/platform/browser";
import {provide} from "angular2/core";
import {Provider} from "angular2/src/core/di/provider";
import {ROUTER_PROVIDERS, APP_BASE_HREF} from "angular2/router";
import {HTTP_PROVIDERS} from "angular2/http";
import 'rxjs/add/operator/map';
import Carbon from "carbonldp/Carbon";
import * as AppContext from "carbonldp/App";
import {AppComponent} from "app/app.component";
let carbon:Carbon = new Carbon();
carbon.setSetting("domain", "dev.carbonldp.com");
carbon.auth.authenticate("user", "password").then(() => {
    return carbon.apps.get("hri-emi-web-app/");
}).then((appContext) => {
    const CARBON_PROVIDER:Provider = provide(Carbon, {
        useValue: carbon,
    });
    const CARBON_APP_PROVIDER:Provider = provide(AppContext.Context, {
        useValue: appContext,
    });
    bootstrap(AppComponent, [
//        FORM_PROVIDERS,
        ROUTER_PROVIDERS,
        HTTP_PROVIDERS,
        provide(APP_BASE_HREF, {useValue: "/src/"}),
        CARBON_PROVIDER,
        CARBON_APP_PROVIDER,
    ]);
}).catch((error) => {
    console.error("Couldn't initialize carbon's app context");
    console.error(error);
});