随笔分类 - Angular
摘要:If our PWA application has a new version including some fixes and new features. By default, when you refresh your page, service worker will check ngsw
阅读全文
摘要:If you alread have an existing Angular application and want to upgrade to progressive web app. 1. Install @angular/service-worker: 2. Create a file: s
阅读全文
摘要:An Angular service registered on the NgModule is globally visible on the entire application. Moreover it is a singleton instance, so every component t
阅读全文
摘要:In our dynamic forms lessons we obviously didn’t account for all the various edge cases you might come across. Therefore if you need a more complex se
阅读全文
摘要:So when you using input binding in Angular, it will always check for update. If you want to improve youre preformence a little bit, you can use @Attri
阅读全文
摘要:In a proper unit test we want to isolate external dependencies as much as possible to guarantee a reliable test outcome. Http calls represent such ext
阅读全文
摘要:In some cases your application might need to upload large amounts of data, such as files. Obviously for a good UX we should provide the user some feed
阅读全文
摘要:By default the new Angular Http client (introduced in v4.3.1) uses JSON as the data format for communicating with the backend API. However, there migh
阅读全文
摘要:By default the response body doesn’t contain all the data that might be needed in your app. Your server might return some special header which you hav
阅读全文
摘要:Besides sending (or requesting) the actual data to the server API, there’s also often the need to send further metadata that helps the server to corre
阅读全文
摘要:When communicating with some backend API, data travels over the network using the HTTP protocol. As such, failures may occur, be it on our own device
阅读全文
摘要:Obviously in a real world application we do not only fetch data from the backend, but we also send data to be stored permanently on the server side. T
阅读全文
摘要:@Directive({ // tslint:disable-next-line:directive-selector selector: '[scrollable]' })
阅读全文
摘要:If you're coming from AngularJS (v1.x) you probably remember the ng-true-value and ng-false-value directive which allowed to map custom boolean values
阅读全文
摘要:The idea is change from: to: To do that, we need to modify tsconfig.json file:
阅读全文
摘要:Compile time configuration options allow you to provide different kind of settings based on the environment you're building the Angular app for. You m
阅读全文
摘要:It always again happens (especially in real world scenarios) that you need to configure your Angular app at runtime. That configuration might be fetch
阅读全文
摘要:@{{user.username}} has {{followerCount}} followers button renders here Follow Unfollow
阅读全文
摘要:For example, what you want to do is navgiate from current item to next or previous item. In your component, you can dispatch action like this: So here
阅读全文
摘要:AuthService: Guard:
阅读全文