Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

How use the plugin? #3

Open
jdmm opened this issue Sep 30, 2016 · 2 comments
Open

How use the plugin? #3

jdmm opened this issue Sep 30, 2016 · 2 comments

Comments

@jdmm
Copy link

jdmm commented Sep 30, 2016

Hello, I can't use the plugin,
I get the following error:
website.assets_frontend.js:1022 Error: Error: Can't resolve all parameters for RequestOptions: (?).(…)(anonymous function) @ website.assets_frontend.js:1022
. I have
the following code:
Can't resolve all parameters for RequestOptions: (?).(…)(anonymous function) @ website.assets_frontend.js:1022.
I have the following code:

import { Component } from '@angular/core';
import { Hero } from './hero';
import { HeroDetailComponent } from './hero-detail.component';
import { HeroService } from './hero.service';
import { OnInit } from '@angular/core';
import {OdooRPCService } from 'angular2-odoo-jsonrpc'
import { Http, ConnectionBackend, RequestOptions } from "@angular/http";

@component({
selector: 'my-app',
template: <h1>{{title}}</h1> <h2>My Heroessss</h2> <ul class="heroes"> <li *ngFor="let hero of heroes" (click)="onSelect(hero)" [class.selected]="hero === selectedHero"> <span class="badge">{{hero.id}}</span> {{hero.name}} </li> </ul> <my-hero-detail [hero]="selectedHero"></my-hero-detail> <!--<my-odoo-rpc></my-odoo-rpc>-->,
providers: [
HeroService,
OdooRPCService,
Http,
ConnectionBackend,
RequestOptions
]

})
export class AppComponent implements OnInit {
title = 'Tour of Heroes';
heroes : Hero[];
selectedHero: Hero;
onSelect(hero: Hero): void {
this.selectedHero = hero;
}

constructor(private heroService: HeroService, public odooRPC: OdooRPCService ){
    console.log('lmdksndksndkns')
    odooRPC.init({
        odoo_server: "https://localhost:8069",
        http_auth: "admin:123" // optional
    });
    odooRPC.login('condominio', 'admin', '123').then(res => {
        console.log('login success');
    }).catch( err => {
        console.error('login failed', err);
    })
}

getConectionOdoo(): void{
    console.log('mknsdjksndkjnskdn')
   this.odooRPC.call('res_partner',"name_search",[],[]).then(res =>{
       console.log('bjdbjsbjdbsjdbjsdb');
       console.log(res);
   }).catch( err => {
        console.error('login failed', err);
    })

}

getHeroes(): void {
    this.heroService.getHeroes().then(heroes => this.heroes = heroes);
 }

ngOnInit(): void {
    this.getHeroes();
    this.getConectionOdoo();

}

}

@drm-code
Copy link

Any updates?

@hengkyz
Copy link
Contributor

hengkyz commented Sep 18, 2017

@drm-code any issue?
please feel free to create new issue, i will help you

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

No branches or pull requests

3 participants