transloco | 🚀 😍 The internationalization library for Angular | Frontend Framework library
kandi X-RAY | transloco Summary
kandi X-RAY | transloco Summary
The internationalization (i18n) library for Angular.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of transloco
transloco Key Features
transloco Examples and Code Snippets
Community Discussions
Trending Discussions on transloco
QUESTION
I have a reactive form group that is working just fine with updateOn submit and updateOn change.
But when I switch to updateOn blur, the required error is triggered directly after entering a character in my custom form control and never goes away. Also, when I submit my form, all the values of my custom form controls are empty (even though the fiels are completed).
My form TS:
...ANSWER
Answered 2021-Dec-01 at 07:48You are actually missing the blur event. Also seems that there is a lot of noise in your code, don't know what for example active
is for. Here is a cleaned up version:
Template:
QUESTION
I know that the following code doesn't work, because the translation file en.json
hasn't been loaded, when ngOnInit()
is called:
component.ts
...ANSWER
Answered 2021-Nov-14 at 23:28I think that you should organize your JSON translation file to have a parent attribute containing all of your 30 translations required by your component (let's call the parent attribute parentAttribute
, but find a better name ;)) :
QUESTION
I would like to use Transloco and gather translations from existing REST API and not from the i18n file. I replaced line in TranslocoHttpLoader by rest service call:
...ANSWER
Answered 2021-Jun-21 at 21:23You're converting it incorrectly
QUESTION
I have a subscription to service:
...ANSWER
Answered 2021-Apr-27 at 11:09I'm sure there's a better way of doing this (there are a lot of operators and use cases around RxJS), but as a valid solution/workaround the problem would get fixed if you just pick up the first emitted observable by using RxJS Operator "take", so you get rid of those repeated subscriptions coming next.
Example: On your AuthService call add a take(1):
QUESTION
I would like to execute toggleButtonOnClick$()
function from the service, only when I click on a button. This function will save current state, service will later receive this change and update usersObs$.
Whenever the above mentioned happens, the toggleButtonOnClick$
gets executed a few more times, even if I didn't click on the button again.
How can I prevent this and make this function only execute when I do .next()
on the clickSubject and not when userObs$ changes?
I will write an example of the whole situation
ButtonComponent
...ANSWER
Answered 2021-Apr-25 at 22:57What I was needing was to use shareReplay(1) and take(1) on different functions on my service to make it work as expected without repeating unnecessary calls.
It would end up looking like this:
QUESTION
I'm using Transloco to manage multiple language in an angular10 project. I created a json i18n file like this:
...ANSWER
Answered 2020-Nov-05 at 21:18You should be able to use a transloco pipe for your translation.
QUESTION
I'm fairly new to Angular and I'm currently struggeling to display errors on my form fields that originate from my API backend. My frontend validation works without any problem.
I've setup my frontend validation according to this link.
This is my form HTML:
...ANSWER
Answered 2020-Sep-02 at 09:02I would try to debug the Form controls properties when they are in the frontend Component (when it is named 'createDetailsForm') and when they are in the validate function (when it is named 'form'). Without testing throughtly it seems that the form object is duplicated and then the changes made in the validate function are not propagated to the form defined in the visual component. I would also try to change the signature of the validate function so it returns the incorrect fields, something like that:
QUESTION
Similar to this question, but it doesn't provide an answer that works for me.
I have a simple component that has a method that opens a dialog:
...ANSWER
Answered 2020-Jul-29 at 04:17Your mock for MatDialog
is not good enough.
QUESTION
In Angular, using Jest we have 2 tests that test a method on a component class:
...ANSWER
Answered 2020-Jul-27 at 13:39If you want to reset the spy count, either reset the mocks inside the test case or inside the afterEach block. It will reset the number of times spy called.
QUESTION
I am trying to set up an Angular 2 project with i18n. Followed the tutorial here using Transloco and all works great. However, when I run the unit tests I get this error and I cant find anything online about it. I am defiantly missing something but I dont know what. Any help would be really appreciated.
...ANSWER
Answered 2020-Jul-24 at 19:01This error is telling you that it is not finding in the app.component.spec.ts
file the provider DEFAULT_LOCALE.
What you need to do is. You need to register DEFAULT_LOCALE
in your app.component.spec.ts
file under TestBed.configureTestingModule
as a provider:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install transloco
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page