• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
1

Great Job on adding Module_Data

Community Beginner ,
Mar 03, 2015 Mar 03, 2015

Copy link to clipboard

Copied

Awesome job on getting us a way to Consume the API from the front end. This is what I needed to get a project I have been working on where I can use BC. I would love to have a way to do POST PUT and DELETE but I'll take what I can get for now. I will use the Webforms for that for now.

This allows me to use Modern Dev frameworks like Angular, etc much easier and is a big win for the way I like to Design and Develop.

I create html pages with the Module_Data tag for each part of my API (i.e):

get-customers.html

{module_data resource="customers" version="v3" fields="id,firstName,middleName,lastName" skip="0" limit="10" order="id" collection="customerData"}

then call a function in in my Angular Controller or Service:

function getCustomers() {

      $http.get('/app/api/get-customers.html?json=true').

      success(function(data, status, headers, config) {

        // this callback will be called asynchronously

        // when the response is available

        $log.debug(data);

      }).

      error(function(data, status, headers, config) {

        // called asynchronously if an error occurs

        // or server returns response with an error status.

      });

    }

Super Easy.

Thank you very much!

Richard Oren

TOPICS
Content management and modules

Views

287

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2015 Mar 03, 2015

Copy link to clipboard

Copied

Just as a note Richard - top limit of data is 500 per pagination set. Keep that in mind.

Also - Look at the liquid options first, lots of cases where you wont need to the javascript solution now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 03, 2015 Mar 03, 2015

Copy link to clipboard

Copied

LATEST

Will do - Thank for the tips Liam.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines