angular2-odoo-jsonrpc
angular2-odoo-jsonrpc copied to clipboard
How use the plugin?
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();
}
}
Any updates?
@drm-code any issue? please feel free to create new issue, i will help you