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










-1















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












share|improve this question



















  • 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















-1















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












share|improve this question



















  • 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













-1












-1








-1








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












share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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












1 Answer
1






active

oldest

votes


















0














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







share|improve this answer























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



    );













    draft saved

    draft discarded


















    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









    0














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







    share|improve this answer



























      0














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







      share|improve this answer

























        0












        0








        0







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







        share|improve this answer













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








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 14:52









        nircraftnircraft

        1,9881524




        1,9881524





























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived