Base solution for your next web application

Activities of "jimchristian"

I started a new application using ASP.Net Zero 1.12 last week. I'm unable to get Swagger to work--all calls to POST methods fail with error 400, which appears to be due to an empty or invalid anti-forgery header token. This happens on both localhost and Azure. Here's my sequence:

  1. Start the application and logon to the host as admin.
  2. Navigate to <server>/swagger, which redirects to <server>/swagger/ui/index. All the services are displayed as usual.
  3. Open Account, /api/Account, enter the following in the body:
{
  "usernameOrEmailAddress": "admin",
  "password": "123qwe"
}

The server sends back a response code of 400 and no body. The other service calls also send back a response code of 400. (I've been testing with GetTenants). I've cleared the cache and tried different browsers on other computers. I used Swagger extensively in a project built on ABP version 0.8.

Although Swagger doesn't work, Postman does work. I can call the /api/Account/Authenticate service using Postman and get back a result token that I can use in other service calls in Postman.

Any ideas?

Question

The standard Web project has a file /app/main/filters/moment_filter.js with the "momentFromNow" filter. How do I add another filter to format dates in another way? I tried this to add a second filter like this:

angular.module('app')
    .filter('momentFromNow', function () {
        return function (input) {
            return moment(input).fromNow();
        };
    })
    .filter('momentFromNow2', function () {
        return function (input) {
            return moment(input).fromNow();
        };
    });

The project builds but I get an error at runtime:

angular.js:13236Error: [$injector:unpr] http://errors.angularjs.org/1.5.0/$injector/unpr?p0=momentFromNow2FilterProvider%20%3C-%20momentFromNow2Filter

It looks like I need to register my new filter, but where? Or am I using the wrong syntax to create a filter?

Showing 1 to 2 of 2 entries