Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-1302

AngularJS 1.6 is causing problems ($http service deprecation)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.3.4.Final
    • 1.3.3.Final
    • Management UI
    • None

      With apiman-1.3.2.Final AngularJS 1.6 is causing problems because the $http service has changed and some of the methods in the UI are deprecated now.

      > The $http legacy promise methods success and error have been deprecated. https://code.angularjs.org/1.5.7/docs/api/ng/service/$http#deprecation-notice

      For example on the page of an single API in the definiton tab you get the following error in your browser console:

      TypeError: $http(...).success is not a function
          at Object.getApiDefinition (apiman-manager-ui.js:1819)
          at loadDefinition (apiman-manager-ui.js:3006)
          at apiman-manager-ui.js:3047
          at apiman-manager-ui.js:1405
          at deps.js:47420
          at completeOutstandingRequest (deps.js:33282)
          at deps.js:33561
      

      In ApiDefintionSvcs in rpc.ts you can fix this with something like this:

      getApiDefinition: function(orgId, apiId, version, handler, errorHandler) {
                          var endpoint = formatEndpoint(
                              Configuration.api.endpoint + '/organizations/:organizationId/apis/:apiId/versions/:version/definition',
                              { organizationId: orgId, apiId: apiId, version: version });
                          $http({
                              method: 'GET', 
                              url: endpoint, 
                              transformResponse: function(value) { return value; }
                          }).then(function (result) {
                              handler(result.data);
                          }, function () {
                              errorHandler();
                          });
                      },
      

              msavy_jira Marc Savy (Inactive)
              fvolk_scheere2e Florian Volk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: