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

            Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

            Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

            How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page