Git Product home page Git Product logo

Comments (11)

httpete avatar httpete commented on June 7, 2024

@Romanchuk any thoughts on this? I think this will block people.

from angular-i18next.

httpete avatar httpete commented on June 7, 2024

I see that you copied their type, I think they were wrong too.

DefinitelyTyped/DefinitelyTyped#25181

from angular-i18next.

Romanchuk avatar Romanchuk commented on June 7, 2024

@httpete Sorry, had no time to answer.
Yes, i use string type for value derrived from these types. You are right, value can be an any type.
There would no problem to fix it for me, because i call format throught call function that is not typed.
I'm going to update package in a week (with this fix and i18next v11 support)

from angular-i18next.

httpete avatar httpete commented on June 7, 2024

ok I will look for it. Thanks - I bet you can limit to Date, String, or Int. I can't imagine formatting any other data type.

from angular-i18next.

Romanchuk avatar Romanchuk commented on June 7, 2024

@httpete version 3.4.1 released. An any type allowed as value.

from angular-i18next.

httpete avatar httpete commented on June 7, 2024

To be more correct, I think restricting it to one of the few would be better:

value: string | Date | Int

from angular-i18next.

Romanchuk avatar Romanchuk commented on June 7, 2024

@httpete i18next has no restrictions on what type it can format. It can be number, string, date or an any complex object, depending of you system requirements.
The main reason why "value" has "any" type - i don't want to set artificial limitations on top of i18next. If i18next has posibillity to format any type, angular-i18next must have it too.

from angular-i18next.

httpete avatar httpete commented on June 7, 2024

I don't see this in 3.4.1.

import { PipeTransform } from '@angular/core';
import { ITranslationService } from './ITranslationService';
export declare class I18NextFormatPipe implements PipeTransform {
    private translateI18Next;
    constructor(translateI18Next: ITranslationService);
    transform(value: string, options: Object | string): string;
}

from angular-i18next.

Romanchuk avatar Romanchuk commented on June 7, 2024

@httpete my fault, i will fix it today

from angular-i18next.

Romanchuk avatar Romanchuk commented on June 7, 2024

@httpete finally, done)

from angular-i18next.

httpete avatar httpete commented on June 7, 2024

thanks Romanchuk! Just for anyone else watching, I was trying to utilize the angularCompilerOption:

    "fullTemplateTypeCheck": true,

which was failing on i18next format pipes (correctly since it was set as string) and after this update, it's perfect. Thank you!

from angular-i18next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.