Action button invoke service web The Next CEO of Stack OverflowTrigger a button click with JavaScript on the Enter key in a text boxInvoking JavaScript code in an iframe from the parent pageHow can I know which radio button is selected via jQuery?How to prevent buttons from submitting formsjQuery disable/enable submit buttonGet the size of the screen, current web page and browser windowHow to check a radio button with jQuery?Using node.js as a simple web serverHow to dispatch a Redux action with a timeout?installation npm failed for an existing project with angular 4
In excess I'm lethal
What was the first Unix version to run on a microcomputer?
Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis
Is there a way to save my career from absolute disaster?
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
Preparing Indesign booklet with .psd graphics for print
How do I make a variable always equal to the result of some calculations?
How do I reset passwords on multiple websites easily?
Make solar eclipses exceedingly rare, but still have new moons
Elegant way to replace substring in a regex with optional groups in Python?
Indicator light circuit
Would a completely good Muggle be able to use a wand?
What happens if you roll doubles 3 times then land on "Go to jail?"
What is the result of assigning to std::vector<T>::begin()?
Sending manuscript to multiple publishers
Why didn't Khan get resurrected in the Genesis Explosion?
Why am I allowed to create multiple unique pointers from a single object?
Received an invoice from my ex-employer billing me for training; how to handle?
Why don't programming languages automatically manage the synchronous/asynchronous problem?
What flight has the highest ratio of time difference to flight time?
If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?
Should I tutor a student who I know has cheated on their homework?
Why do remote companies require working in the US?
Why do professional authors make "consistency" mistakes? And how to avoid them?
Action button invoke service web
The Next CEO of Stack OverflowTrigger a button click with JavaScript on the Enter key in a text boxInvoking JavaScript code in an iframe from the parent pageHow can I know which radio button is selected via jQuery?How to prevent buttons from submitting formsjQuery disable/enable submit buttonGet the size of the screen, current web page and browser windowHow to check a radio button with jQuery?Using node.js as a simple web serverHow to dispatch a Redux action with a timeout?installation npm failed for an existing project with angular 4
I am beginner in angular and i want to add to add button an action that invokes a web service that sends itself to a node server to add a user. i work on a template (nebular-ngx) .
enter link description here
this the code of my add button with angular4
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
i wonna add an action who invoke a service web and send it to a node server
this is my hole code
import Component from '@angular/core';
import LocalDataSource from 'ng2-smart-table';
import SmartTableData from '../../../@core/data/smart-table';
@Component(
selector: 'ngx-smart-table',
templateUrl: './smart-table.component.html',
styles: [`
nb-card
transform: translate3d(0, 0, 0);
`],
)
export class SmartTableComponent
settings =
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
edit:
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
delete:
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
,
columns:
id:
title: 'ID',
type: 'number',
,
firstName:
title: ' Name',
type: 'string',
,
email:
title: 'E-mail',
type: 'string',
,
password:
title: 'password',
type: 'password',
,
,
;
source: LocalDataSource = new LocalDataSource();
constructor(private service: SmartTableData)
const data = this.service.getData();
this.source.load(data);
onDeleteConfirm(event): void
if (window.confirm('Are you sure you want to delete?'))
event.confirm.resolve();
else
event.confirm.reject();
javascript node.js angular
add a comment |
I am beginner in angular and i want to add to add button an action that invokes a web service that sends itself to a node server to add a user. i work on a template (nebular-ngx) .
enter link description here
this the code of my add button with angular4
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
i wonna add an action who invoke a service web and send it to a node server
this is my hole code
import Component from '@angular/core';
import LocalDataSource from 'ng2-smart-table';
import SmartTableData from '../../../@core/data/smart-table';
@Component(
selector: 'ngx-smart-table',
templateUrl: './smart-table.component.html',
styles: [`
nb-card
transform: translate3d(0, 0, 0);
`],
)
export class SmartTableComponent
settings =
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
edit:
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
delete:
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
,
columns:
id:
title: 'ID',
type: 'number',
,
firstName:
title: ' Name',
type: 'string',
,
email:
title: 'E-mail',
type: 'string',
,
password:
title: 'password',
type: 'password',
,
,
;
source: LocalDataSource = new LocalDataSource();
constructor(private service: SmartTableData)
const data = this.service.getData();
this.source.load(data);
onDeleteConfirm(event): void
if (window.confirm('Are you sure you want to delete?'))
event.confirm.resolve();
else
event.confirm.reject();
javascript node.js angular
2
can you be more clear on what you need? You can make the service call on button click.
– nircraft
Mar 8 at 14:44
code please....
– Aragorn
Mar 8 at 14:46
ok i'll edit my post .......
– Meriem Bader
Mar 8 at 14:57
add a comment |
I am beginner in angular and i want to add to add button an action that invokes a web service that sends itself to a node server to add a user. i work on a template (nebular-ngx) .
enter link description here
this the code of my add button with angular4
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
i wonna add an action who invoke a service web and send it to a node server
this is my hole code
import Component from '@angular/core';
import LocalDataSource from 'ng2-smart-table';
import SmartTableData from '../../../@core/data/smart-table';
@Component(
selector: 'ngx-smart-table',
templateUrl: './smart-table.component.html',
styles: [`
nb-card
transform: translate3d(0, 0, 0);
`],
)
export class SmartTableComponent
settings =
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
edit:
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
delete:
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
,
columns:
id:
title: 'ID',
type: 'number',
,
firstName:
title: ' Name',
type: 'string',
,
email:
title: 'E-mail',
type: 'string',
,
password:
title: 'password',
type: 'password',
,
,
;
source: LocalDataSource = new LocalDataSource();
constructor(private service: SmartTableData)
const data = this.service.getData();
this.source.load(data);
onDeleteConfirm(event): void
if (window.confirm('Are you sure you want to delete?'))
event.confirm.resolve();
else
event.confirm.reject();
javascript node.js angular
I am beginner in angular and i want to add to add button an action that invokes a web service that sends itself to a node server to add a user. i work on a template (nebular-ngx) .
enter link description here
this the code of my add button with angular4
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
i wonna add an action who invoke a service web and send it to a node server
this is my hole code
import Component from '@angular/core';
import LocalDataSource from 'ng2-smart-table';
import SmartTableData from '../../../@core/data/smart-table';
@Component(
selector: 'ngx-smart-table',
templateUrl: './smart-table.component.html',
styles: [`
nb-card
transform: translate3d(0, 0, 0);
`],
)
export class SmartTableComponent
settings =
add:
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
edit:
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
,
delete:
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
,
columns:
id:
title: 'ID',
type: 'number',
,
firstName:
title: ' Name',
type: 'string',
,
email:
title: 'E-mail',
type: 'string',
,
password:
title: 'password',
type: 'password',
,
,
;
source: LocalDataSource = new LocalDataSource();
constructor(private service: SmartTableData)
const data = this.service.getData();
this.source.load(data);
onDeleteConfirm(event): void
if (window.confirm('Are you sure you want to delete?'))
event.confirm.resolve();
else
event.confirm.reject();
javascript node.js angular
javascript node.js angular
edited Mar 8 at 15:07
Meriem Bader
asked Mar 8 at 14:38
Meriem BaderMeriem Bader
137
137
2
can you be more clear on what you need? You can make the service call on button click.
– nircraft
Mar 8 at 14:44
code please....
– Aragorn
Mar 8 at 14:46
ok i'll edit my post .......
– Meriem Bader
Mar 8 at 14:57
add a comment |
2
can you be more clear on what you need? You can make the service call on button click.
– nircraft
Mar 8 at 14:44
code please....
– Aragorn
Mar 8 at 14:46
ok i'll edit my post .......
– Meriem Bader
Mar 8 at 14:57
2
2
can you be more clear on what you need? You can make the service call on button click.
– nircraft
Mar 8 at 14:44
can you be more clear on what you need? You can make the service call on button click.
– nircraft
Mar 8 at 14:44
code please....
– Aragorn
Mar 8 at 14:46
code please....
– Aragorn
Mar 8 at 14:46
ok i'll edit my post .......
– Meriem Bader
Mar 8 at 14:57
ok i'll edit my post .......
– Meriem Bader
Mar 8 at 14:57
add a comment |
1 Answer
1
active
oldest
votes
You can use your button click event to make the service call from component:
<button class="btn btn-primary" (click)="makeServiceCall($event)">Add</button>
In component:
makeServiceCall(e)
this.myAngularService.makeHttpRequest().subscribe((response: Response) =>
// my response here
, (error: any) =>
console.log(error);
);
Inside myAngularService
, make use of angular's HttpClient to make the service call:
import Injectable from '@angular/core';
import HttpClient from '@angular/common/http';
@Injectable()
export class myAngularService
constructor(private http: HttpClient)
makeHttpRequest()
return this.http.get<any>('my_service_url);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065418%2faction-button-invoke-service-web%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use your button click event to make the service call from component:
<button class="btn btn-primary" (click)="makeServiceCall($event)">Add</button>
In component:
makeServiceCall(e)
this.myAngularService.makeHttpRequest().subscribe((response: Response) =>
// my response here
, (error: any) =>
console.log(error);
);
Inside myAngularService
, make use of angular's HttpClient to make the service call:
import Injectable from '@angular/core';
import HttpClient from '@angular/common/http';
@Injectable()
export class myAngularService
constructor(private http: HttpClient)
makeHttpRequest()
return this.http.get<any>('my_service_url);
add a comment |
You can use your button click event to make the service call from component:
<button class="btn btn-primary" (click)="makeServiceCall($event)">Add</button>
In component:
makeServiceCall(e)
this.myAngularService.makeHttpRequest().subscribe((response: Response) =>
// my response here
, (error: any) =>
console.log(error);
);
Inside myAngularService
, make use of angular's HttpClient to make the service call:
import Injectable from '@angular/core';
import HttpClient from '@angular/common/http';
@Injectable()
export class myAngularService
constructor(private http: HttpClient)
makeHttpRequest()
return this.http.get<any>('my_service_url);
add a comment |
You can use your button click event to make the service call from component:
<button class="btn btn-primary" (click)="makeServiceCall($event)">Add</button>
In component:
makeServiceCall(e)
this.myAngularService.makeHttpRequest().subscribe((response: Response) =>
// my response here
, (error: any) =>
console.log(error);
);
Inside myAngularService
, make use of angular's HttpClient to make the service call:
import Injectable from '@angular/core';
import HttpClient from '@angular/common/http';
@Injectable()
export class myAngularService
constructor(private http: HttpClient)
makeHttpRequest()
return this.http.get<any>('my_service_url);
You can use your button click event to make the service call from component:
<button class="btn btn-primary" (click)="makeServiceCall($event)">Add</button>
In component:
makeServiceCall(e)
this.myAngularService.makeHttpRequest().subscribe((response: Response) =>
// my response here
, (error: any) =>
console.log(error);
);
Inside myAngularService
, make use of angular's HttpClient to make the service call:
import Injectable from '@angular/core';
import HttpClient from '@angular/common/http';
@Injectable()
export class myAngularService
constructor(private http: HttpClient)
makeHttpRequest()
return this.http.get<any>('my_service_url);
answered Mar 8 at 14:52
nircraftnircraft
1,9881524
1,9881524
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065418%2faction-button-invoke-service-web%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
can you be more clear on what you need? You can make the service call on button click.
– nircraft
Mar 8 at 14:44
code please....
– Aragorn
Mar 8 at 14:46
ok i'll edit my post .......
– Meriem Bader
Mar 8 at 14:57