89 Matching Annotations
  1. Jan 2025
    1. Modular development is a significant advantage of Angular development services. In this instance, mobile applications are separated into manageable, compact pieces. Developers may now create apps with disparate components that function as a whole. It makes debugging and development easier.

      Learn how Angular can enhance your mobile app development, offering powerful features for seamless cross-platform applications. Explore the benefits of using angular for mobile app development, from scalability to easy integration with other tools, and why it’s a top choice for developers.

  2. Dec 2023
  3. May 2023
  4. Dec 2022
  5. Mar 2022
  6. Nov 2021
  7. Jun 2021
    1. Angular is nothing but an open-source web application framework. It is being led by the Angular Team at Google and also by a community of individuals and corporations. It is based on TypeScript.Angular is a complete rewrite from the same team that had built AngularJS. It can be used as the frontend of the MEAN stack, which consists of the MongoDB database, Express.js web application server framework, Angular itself (or AngularJS), and the Node.js server runtime environment.

      Top Angular 8 Interview Questions to get you ready

  8. Feb 2021
  9. Nov 2020
    1. Content is what is passed as children usually to be projected at some <ng-content> element of a component. View is the template of the current component. The view is initialized after the content and ngAfterViewInit() is therefore called after ngAfterContentInit().
    1. In Angular CLI 6 this command has been removed, and it will not come back. Instead there is a new concept called Builders.With the new Angular CLI you can customize the build process by defining your own builders as well as using one of the builders provided by the community.

      Why did they remove it if it was useful? They wanted people to be stuck in Angular CLI world? Couldn't they still provide that escape route / migration path for those that really do need/want to eject?

  10. Oct 2020
  11. Sep 2020
    1. I think Svelte's approach where it replaces component instances with the component markup is vastly superior to Angular and the other frameworks. It gives the developer more control over what the DOM structure looks like at runtime—which means better performance and fewer CSS headaches, and also allows the developer to create very powerful recursive components.
  12. Aug 2020
    1. The let keyword declares a template input variable that you reference within the template. The input variables in this example are hero, i, and odd. The parser translates let hero, let i, and let odd into variables named let-hero, let-i, and let-odd.
  13. Apr 2020
    1. SPAs are incredibly common, popularised by client-side web frameworks like Angular, React and Vue.js.

      SPAs:

      • popularised by client-side web frameworks like Angular, React and Vue.js
      • real difference between the MVP app is shifting most of its work on the client side
      • there's client side MVC, MVVM (model-view-view-model) and FRP (functional reactive programming)

      Angular - client side MVC framework following its pattern, except it's running inside the users web browser.

      React - implementation of FRP. A little more flexible, but more concerned with state change events in data (often using some event store like Redux)

  14. Nov 2019
  15. Oct 2019
  16. Sep 2019
  17. May 2019
    1. But like its usual in the case of Observable-based APIs, FRP techniques can help easily implement many use cases that would otherwise be rather hard to implement such as: pre-save the form in the background at each valid state, or even invalid (for example storing the invalid value in a cookie for later use) typical desktop features like undo/redo

      key point on why FRP is good: misc usages on each 'state' change in the form - record and save state for 'undo' feature, save to local storage to be recovered later, etc

    2. This is why this is called template-driven forms, because both validation and binding are all setup in a declarative way at the level of the template.

      key point on naming of 'template-driven forms'

    3. You are probably wondering what we gained here. On the surface there is already a big gain: We can now unit test the form validation logic

      key point - advantage of reactive forms is the testability of its validation

  18. Dec 2018
    1. Then inject it inside a test by calling TestBed.get() with the service class as the argument. it('should use ValueService', () => { service = TestBed.get(ValueService); expect(service.getValue()).toBe('real value'); });

      this is for testing the service, directly

    2. However, you almost always inject service into application classes using Angular dependency injection and you should have tests that reflect that usage pattern. Angular testing utilities make it easy to investigate how injected services behave.

      key point

    1. We can even remove the AuthService import if we want, there really is no dependency on anything else. The LoginComponent is tested in isolation:

      that's a key point - isolating stuff. remember this is unit testing, not integration tests. we wish to have as little as dependencies as possible.

    2. That’s not very isolated but also not too much to ask for in this scenario. However imagine if LoginComponent required a number of other dependencies in order to run, we would need to know the inner workings of a number of other classes just to test our LoginComponent. This results in Tight Coupling and our tests being very Brittle, i.e. likely to break easily. For example if the AuthService changed how it stored the token, from localStorage to cookies then the LoginComponent test would break since it would still be setting the token via localStorage.

      key points - this shows the benefits (easy) of this kind of testing and its disadvantages (coupled, easy to break if a service changes its implementation)

  19. Nov 2018
    1. Or inside the beforeEach() if you prefer to inject the service as part of your setup. beforeEach(() => { TestBed.configureTestingModule({ providers: [ValueService] }); service = TestBed.get(ValueService); });

      this corresponds with the option mentioned above - inject it inside a single test

  20. Oct 2018
  21. Sep 2018
    1. When we use ng new the Angular CLI creates a new workspace for us.In our Angular workspace we are going to have two projects:A library projectThis is the library of components and services that we want to provide. This is the code that we could publish to npm for example.An application projectThis will be a test harness for our library. Sometimes this application is used as documentation and example usage of the library.

      Good ideas about what to do with the needed 'application' that we are forced to create just to create the library.

    1. When we’ve generated the library (ng generate library tvmaze ) Angular CLI modified the tsconfig.json in the root of our project by adding tvmaze to the paths entry.

      Read - this is how to fake a local library to be imported by TS as if it was in node_modules

  22. Aug 2018
    1. The custom id is persistent. The extractor tool does not change it when the translatable text changes. Therefore, you do not need to update the translation. This approach makes maintenance easier

      key point! it allows English speaking site without worrying about translations at all, and keeping translation unit keys constant over time even if the English text is changing

    2. The Angular extraction tool preserves both the meaning and the description in the translation source file to facilitate contextually-specific translations, but only the combination of meaning and text message are used to generate the specific id of a translation. If you have two similar text messages with different meanings, they are extracted separately. If you have two similar text messages with different descriptions (not different meanings), then they are extracted only once

      important - this is how the 'keys' for the translation person are extracted - what determines the singularity of the translation item.

    3. The CLI imports the locale data for you when you use the parameter --configuration with ng serve and ng build

      See sample i18n app (link in the beginning of this document). Basically, in package.json: "scripts": { "start": "ng serve", "start:fr": "ng serve --configuration=fr", "build": "ng build --prod", "build:fr": "ng build --configuration=production-fr",

    1. To define a class as a service in Angular, use the @Injectable() decorator to provide the metadata that allows Angular to inject it into a component as a dependency. Similarly, use the @Injectable() decorator to indicate that a component or other class (such as another service, a pipe, or an NgModule) has a dependency.

      This means that the 'injectable' decorator has two meanings and two usages. I think this wasn't so in the past.

  23. Jul 2017
  24. Mar 2017
  25. Feb 2017
    1. In general, add providers to the root module so that the same instance of a service is available everywhere.

      So, from this I take it that once a Service is added to the root module, it can be used by any component of that module.

      What about the components imported, from sub-modules of the root one? Can their dependency needs be met, in similar fashion? For example, could a Component in another module (imported into the root one) just request a Service provided in the root module and have it properly injected from there, without anything else on the developer's part?

  26. Jan 2017
    1. While a component is technically a directive, components are so distinctive and central to Angular applications that this architectural overview separates components from directives.

      As per the MVVM pattern, they sort of provide the support for the View. They are like the glue for the visual representation of a part of the application. A controller of sorts (but not quite one) of MVC.

  27. Dec 2016
  28. Aug 2016
  29. May 2016
    1. bower_components

      Ionic installs bower components (bower packages) into the project's lib folder:

      www/lib 
      

      This behaviour is defined in the projects .bowerrc file, which looks like this:

      {
        "directory": "www/lib"
      }
      

      The project .bowerrc file may be found at the same level as the www folder.

      Note that if you install angular-chart this way, you don't need to install Chart.js separately; it is one of the dependencies that bower will install for you. Of course, you must include the script tag that references the Chart.js file as usual!

      Finally, if you want to link angular-chart.css you must follow the same procedure.

  30. Mar 2016
  31. Jan 2016
  32. Aug 2015
    1. Angular 2 embraces web platform standards, so it puts the view of the component in the Shadow DOM of the element where it has been created. If your browser does not support Shadow Dom, Angular will emulate it on a par with native shadow DOM.

      At the time this was written I don't think vendors were anywhere near agreement on several major aspects of shadow DOM

  33. Jun 2015