How to create an auto-grow directive in Angular 2

Angular 2, AngularJS
How to create an auto-grow directive in Angular 2 This article will explain how you can create a directive to automatically adjust the height of a textarea to its content. Step 1 - create the directive with angular-cli If you have not already, install angular-cli. Go to the root of your project (the folder containing "package.json"), open a shell and execute the following statements:[crayon-5a37802b2a878237486469/]These statements will create a basic directive file and wire it into your application.[crayon-5a37802b2a882348844958/]You can change the selector to '[autoGrow]' if you want. Step 2 - add the auto-grow code Change the code of the auto-grow directive as follows:[crayon-5a37802b2a892973807472/]Save this file and it is ready for use. Step 3 - using the directive We are ready to use the directive. We do not need to add the…
Read More
Angular 2 TODO List example

Angular 2 TODO List example

Angular 2, AngularJS, JavaScript, TypeScript
How to create a TODO list in Angular 2 There are a lot of examples on how to create a TODO List in Angular 2 on the web, but lots of them use outdated versions. Most of these examples use Alpha, Beta and RC versions. The problem is that they are already outdated and no longer compatible with the most recent version of Angular 2. The following example uses the 2.2.1 version. This is the most recent version at the time of writing. https://github.com/resolvethis/ng2-todo This example contains the basics about Creating components Communicating between components Creating routes Clone or download the sample code from github and start playing with the example. Check back soon for more details and explanation on this example.
Read More