Base solution for your next web application

Activities of "abarref"

Update: in our case it was Syncfusion material.css that had an internal import of Google Fonts.

Hi @dzungle, I'm having the same problem. How did you resolve it? Thanks

Question

Hi, Are there any plans on upgrading to Angular 16? Thanks.

Just doing a search and replace of "net5.0" to "net6.0" seems to fix it. The solution is now working for me.

Same issue. Web.Host.csproj has

<TargetFramework>net5.0</TargetFramework>
Question

Hi,

Do you people know when the Angular-Metronic project will be upgraded to Angular 9?

Thanks

Hi,

How can I modify rounterTransition.ts to disable the sliding animations? I would want to disable them here so it disables the animations globally for the entire app.

import { animate, state, style, transition, trigger } from '@angular/animations';

export function appModuleAnimation() {
    return slideFromBottom();
}

export function accountModuleAnimation() {
    return slideFromUp();
}

export function slideFromBottom() {
    return trigger('routerTransition', [
        state('void', style({ 'padding-top': '20px', opacity: '0' })),
        state('*', style({ 'padding-top': '0px', opacity: '1' })),
        transition(':enter', [
            animate('0.33s ease-out', style({ opacity: '1', 'padding-top': '0px' }))
        ])
    ]);
}

export function slideFromUp() {
    return trigger('routerTransition', [
        state('void', style({ 'margin-top': '-10px', opacity: '0' })),
        state('*', style({ 'margin-top': '0px', opacity: '1' })),
        transition(':enter', [
            animate('0.2s ease-out', style({ opacity: '1', 'margin-top': '0px' }))
        ])
    ]);
}
Answer

Yes, I saw that. I was wondering if there was something similar to the AddOrUpdate method of ConcurrentDictionary. I ended up writing the following extension method:

public static class CacheExtensions
{
    public static TValue GetOrUpdate<TKey, TValue>(this ICache cache, TKey key, Func<TValue> seedFactory, Func<TValue, TValue> updateFactory)
    {
        lock (cache)
        {
            var value = cache.Get(key, k => seedFactory());

            value = updateFactory(value);

            cache.Set(key.ToString(), value);

            return value;
        }
    }
}
Question

The ICache only has Get and Set separately. Must I handle concurrency by myself or there is some extension method similar to ConcurrentDictionary.AddOrUpdate? Thanks in advance

Sorry, I ommitted some lines that I thought were not required. This is my full service.extensions.ts:

import {map} from 'rxjs/operators';

export class ClientBase {
    protected transformOptions(options: any) {
        // Change options if required

        // console.log('HTTP call, options: ' + JSON.stringify(options));
        //
        // options.headers.append("myheader", "myvalue");

        // if (options != null) {
        //     options.isServiceProxyRequest = true;
        // }

        // options.responseType = 'json';

        // @ts-ignore
        return Promise.resolve(options);
    }

    protected transformResult<R, U>(url: string, response: R, processor: (response: R) => U) {
        let observable = processor(response);

        // @ts-ignore
        observable = observable.pipe(map((data) => {
            return this.isEmptyObject(data) ? null : data;
        }));

        return observable;
    }

    // Reference: https://stackoverflow.com/a/32108184/1454888
    isEmptyObject(obj) {
        if (obj == null) {
            return true;
        }

        if (obj.constructor === Array || obj.constructor === ArrayBuffer) {
            return false;
        }

        for (let prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                return false;
            }
        }

        return JSON.stringify(obj) === JSON.stringify({});
    }
}

So to avoid those compilation issues I added // @ts-ignore on top of them

Showing 1 to 10 of 26 entries