You are new or have some experience in Angular and now want to take the step to became an expert in Angular and want to learn more about how you can apply the new concepts specifically for an Interview or developing robust web apps as well as mobile apps.This book has the collection of Angular 2 Interview Questions and Answers with TypeScript. As you know, Angular 2 is a most popular framework for developing mobile as well as web applications. Angular 2 is so simpler, faster, modular and instrumented design and it is developed by Google and Misko Hevery is the father of Angular. Continue reading

Comparatively, while Angular does require you to do the splitting up into MVC components of your app, it puts them back together by itself, with no input from you. Another quirk of Angular is the fact that it uses the HTML to define the app’s user interface. Directives are Angular’s way of bringing additional functionality to HTML. There are many reasons why you would want to choose Angular for your projects, not only the ones mentioned above but also a lot more depending on what your requirements are and how you want to improve your web application. However, my advice for you is: Keep in mind solely the needs and requirements of your app and then decide which technology is the most suitable one, without being influenced by the opinions of critics and Angular lovers. Continue reading

We’ll accomplish this by creating a popover service that exposes an API that allows us to open a popover relative to any origin element, render a custom component, template, or simple text inside it, and get notified when it’s closed. As always, here is a visualization of the final result:And here is a usage example:We’re injecting the Popover service and calling the open() method, passing the origin, a custom component and optional data object that will be available inside the component via DI. The open() method takes the origin element, which is the DOM element we want our popover to connect to, the content that could be a template, component, or simple text, a data object which will be passed to the provided component via DI and optional width and height. So, in our case, we preferred a top position with a fallback of a bottom position, which gives us the following functionality:Scrolling…Here are more predefined positions for your convenience:Back to the code, we set the withPush() method to false as we don’t want the overlay to be pushed on-screen if none of the provided positions fit. Great, we have an injector, now let’s move on to the final step — attaching the popover component to the overlay. Continue reading

However, frameworks such next.js are changing the landscape making development easier and faster, adding client side features; and in general providing the same SPA experience while rendering the HTML on the server. So, a hybrid framework brings more features than a PWA, allowing you more control over the device but it is just focus on mobile applications delivered to the App and Play stores, so they are different. Hybrid Frameworks: Hybrid Native vs Hybrid WebHave a look to this great video which compares the different hybrid frameworks. There are frameworks such Ionic which run on the WebView(browser, Hybrid web) and hybrid native frameworks like React Native or NativeScript that use JavaScript but compile to native code which is faster. NativeScript supports Angular and React and is also easy to user and faster than Ionic; but still more difficult to implement and way less popularFlutter is getting a lot traction, it is a great framework and you can build unimaginable user experience that you can only do with real native apps. Continue reading

One of my last assignments was to develop generic method to make components and templates searchable in our application. We’ll use this feature to register each searchable directive in our SearchableContainer component. Create the Searchable DirectiveAs stated before, we’re asking Angular to provide us with the SearchableContainer and register the current instance. Now, let’s go back to the search() method implementation:When we receive a new search term, we need to loop over the searchable directives, check if we have a match and run the corresponding method accordingly. The highlight() method takes the searchable token and the current search term and sets the innerHTML of the host element after sanitizing it for security reasons. Continue reading

Not a lot of new features in this release: the Angular team is still mainly focused on the Ivy project, rewriting the Angular compiler and runtime code to make it smaller, better, faster. I was mentioning in our article about Angular 7.1 that the Bazel support was making progress, and this 7.2 release brings a cool new feature. You can override this behavior by using another value for this option like , to also trigger the guards and resolvers if a query parameter changes, or to trigger them if anything changes. Using this value, the guards and resolvers will run if a path parameter changes, but not if a query or matrix parameter changes. using this value, the guards and resolvers will run if a path parameter or a query parameter changes, but not if a matrix parameter changes. Continue reading

In short you can ouput your CSS in instead of the root of the output folder with:

The flag of used to take a boolean value: to generate the source maps for styles and scripts, to ignore them. Similarly, the flag used to take a boolean value: to activate scripts and styles optimization, to ignore them (leading to faster builds). Now you can activate one or the other, as can now take an object to configure it:

A new flag called has been added to . A new flag is available for this command to detail what exactly is going on and help debug potential issues. The team took the occasion to deprecate a few flags from the CLI itself:

Note that you will now have a warning when you specify a flag several times in the same command. Continue reading

As the lead designer/front-end architect, the Angular team invited me to write on the official blog in order to communicate what Angular Console is and what it means for the Angular community going forward. Visualizing the Angular CLIIn its current form, Angular Console aims to provide an easy to understand interface for the Angular CLI. For more practiced developers, the benefit of mirroring the Angular CLIs core concepts is that they no longer have to parse the Angular CLI’s metadata containing JSON in order to understand an Angular workspace’s structure. WorkspacesWhen launching console, you are immediately presented with a list of all the Angular workspaces you’ve imported into Console in the past. This will make Console an official tool and will give the community the confidence that Console is here to stay, and that is is a tool every developer should have in their toolbelt alongside Angular CLI. Continue reading

The Angular CLI is a command line interface tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment. To implement the Lazy Loading in Angular we need to create a and a file for the component we need to lazy load. In the app.module.ts file we need to remove the declarations for the components which we would like to lazy load. This is our final output

Have you seen in the above image we successfully implemented the lazy loading? Continue reading

If we know that we’re dealing with such a case it is OK to subscribe to an Observable without providing any unsubscription logic.These components and services will live for the whole duration of the application lifetime so they will not produce any memory leaks. As we re-create our components we keep adding more and more subscriptions, hence the memory leak…Subscribing to an observable yields us Subscription object which has an unsubscribe() method. pipe() method of the observable to add operators, in our case takeUntil to the observable chainThis solution is declarative! next() and .complete() methods in the ngOnDestroy implementation (leaving it empty)

In case you’re saying that you will just always check for it, sure, I was thinking the same until I discovered couple of memory leaks in one of my applications with exactly this issue!The largest problem with this is that these two things will NOT result in any obvious errors whatsoever so they are very easy to miss! The | async pipes automatically unsubscribes all active subscriptions when component is destroyedExample of using | async pipe to unwrap stream of todoState to use it in the templateAnother big advantage of using | async pipe together with *ngIf directive is that we can guarantee that the unwrapped value will be available to all child components at the time they are rendered. Continue reading

As days are getting colder and evenings become darker, it's a good idea to gather together over a beer and meet again for yet another Angular Dragons event this year. If you feel like you can share your thoughts and experience, contact us at [masked] or via meetup. There always is the first time, and we can help you surviving it 🙂

Agenda:

• 17:30 Registration

• 18:00 Welcome & Industry news

• 18:10 Tomasz Błachut – Go live with can decide that the product you're working on will be chosen over competing one. • 19:00 Intermission

npm install -g vue-cliand then to create your new project you can run:vue create enter the name of your appBeside package.json, which contains the configuration, these are the files contained in your initial project you run yarn serve you get your first example running and displaying this:Let’s create our first vue custom elementfor demo purposes, I’ll create another component called ButtonCounter that is going to emit a counter of how many times it was clicked to it’s parent and the grand parents. To use your newly built VueJs custom element, you need only to import it to an html file like any other javascript code, import the VueJs library; because it’s not included deliberately in the build. Here is an example of a Polymer component using my-custom-element; Vue custom element created previously. In this example you can see how to use the Custom element inside an Angular component. To use your Vue custom element inside React app you need to import it as any Javascript file into the index.html file in addition to the Vue library. Continue reading

The first time I thaught about self solution in 2010 when realized that to do company project I have to use huge, complex, expensive UI framework that does not provide ability to use only grid. Sorely frameworks are good only about application architecture but they lack about ability to build fast and complex component with huge data as grid. Standalone Independent solutions with good level are presented by just several grids. It was founded by Niall Crosby who was Java developer and worked in banks for years and he tired of situation that there is not good level grid product for banks. It does not have 100% of grid features since it is impossible to implement all grid features but it is the product that will suit to any company. Continue reading

Debugging and Testing Angular Schematics in VS CodeI spent the night after Mike Brocchi’s talk at NgAtlanta 2018 working through how to use custom schematics to extend or replace the files output by Angular CLI. When it came time to make sure we had a fully functional application, we had little choice but to run the following set of commands:npm run buildng new demo-schematic –skipInstall=true# open VS code to see if the output code passes the eyeball testnpm installng servePassable for a first iteration, but not a development cycle I would endorse for anyone long-term, especially since the issue most frequently revealed by the install/serve cycle was typos: 😤. In this post, I will cover setting up VS Code to debug unit tests for Angular schematics; debugging schematics outside of the unit test context; and a thought experiment about how we might improve the development lifecycle I mentioned above. The VS Code documentation offers this summary:[Tools] to automate tasks like linting, building, packaging, testing, or deploying software systems … are mostly run from the command line and automate jobs inside or outside the inner software development loop … Given their importance in the development life-cycle, it is very helpful to be able to run tools and analyze their results from within VS Code.Similar to the structure of launch.json, this file contains the set of potential tasks for us to invoke. Here’s a brief, but non-exhaustive list, of some of the rough edges on this draft:Test fragilityMaintaining custom matcher code independently of application codeProviding meaningful error messages about the characters where the file contents start to ergeSynchronous vs. asynchronous interactions with the file system and unit test library

As you can see, it’s still a work in progress and I’m still reasoning through whether the additional complexity (even if it’s just more lines of code) adds value and reliability to our development lifecycle, or just complexity. Continue reading

Did we miss something? Do you have feedback on how we can improve? Contact us.