随笔分类 - Angular
摘要:We have a form component: the 'type' FormControl will be a custom form element component which refers to 'workout-type' componet. For the workout-type
阅读全文
摘要:Currently, patchValue doesn't support update FormArray. The workarround is you need to empty the form array first, then add items back.
阅读全文
摘要:Which hash algorithom to choose for new application: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet Argon2[*7] is the winner of the pass
阅读全文
摘要:One thing that we can do is to add styles directly to HTML elements that live within our component. However, in this lesson we see that style classes
阅读全文
摘要:Angular has a very robust security model. Dynamically inserted html, style or url values into the DOM open up possibilities for attackers to compromis
阅读全文
摘要:We will learn how to make use of the ngStyle directive to directly add multiple style attributes to a DOM element as a style property. We’ll also lear
阅读全文
摘要:It it recommeded that when deals with form component, we can create a container component to hold state, and then create a stateless component to enpo
阅读全文
摘要:From Anuglar v4 above, we are able to using 'as' with async pipe. This allow as using 'new variable' instead of subscribe to observable. We also able
阅读全文
摘要:For example, when we open a form, we want to see all the inputs fields comes into one by one. Code for html: So we add a animation to the container ca
阅读全文
摘要:A simple store implemenet: Using this store in AuthService: Using Reactive approach in app.component.ts:
阅读全文
摘要:Config AngularFire, we need database and auth module from firebase. For the SharedModule: We use forRoot method to register our AuthSerivce, so there
阅读全文
摘要:Automate all the things!! Automation is crucial for increasing the quality and productivity. In this lesson we will learn how to automate the deployme
阅读全文
摘要:Being able to intercept HTTP requests is crucial in a real world application. Whether it is for error handling and logging or for injecting authentica
阅读全文
摘要:Simple Auth service: Using Observable is a easy way to implement reactive application. Create a BehaviorSubject and then convert subject to Observable
阅读全文
摘要:For example, inside you component you want to import a file from two up directory: This becomes a little bit problematic because the component can be
阅读全文
摘要:We have two blocks to show to difference ways to do animation in Angular: heightZeroFull using animation(). heightState using state(). The way to cont
阅读全文
摘要:To define an Angular Animation, we using DSL type of language. Means we are going to define few animations ('fadeIn', 'fadeOut'). Then we need to defi
阅读全文
摘要:When we "Tab" into a input field, we want to select all the content, if we start typing, it should remove the existing content and add new content. We
阅读全文
摘要:We can use 'setSelectionRange(start, end)' to set cursor postion, in which start postion = end position.
阅读全文
摘要:@HostListener('keydown', ['$event', '$event.keyCode']) onKeyDown($event: KeyboardEvent, keyCode) { if(keyCode !== TAB) { $event.preventDefault(); } // get value for the key ...
阅读全文