angular2-odoo-jsonrpc icon indicating copy to clipboard operation
angular2-odoo-jsonrpc copied to clipboard

How use the plugin?

Open jdmm opened this issue 8 years ago • 2 comments

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();

}

}

jdmm avatar Sep 30 '16 19:09 jdmm

Any updates?

drm-code avatar Sep 17 '17 12:09 drm-code

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

hengkyz avatar Sep 18 '17 01:09 hengkyz