Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Profile photo of Bob at Genuitec
Bob at Genuitec
Virtual evangelist at large. The face of Genuitec often appearing in graphics. Pen-name for our more shy writers of content.

In this Angular tutorial, we are going to create a Note Taking App using Angular IDE.

Create New Angular Project

We’re going to be using Angular IDE in this tutorial, though you can use Webclipse or MyEclipse, following exactly the same steps. Before beginning, do ensure you are in the Angular Perspective (Window > Perspective > Open Perspective > Other > Angular) for an optimum workspace layout and development experience.

In the new Angular project wizard (File > New > Angular Project), type quicknotes as the project name – you may change the Node.js, npm and Angular CLI versions if desired (Angular CLI version must be 1.5.0 or later).

notetaking-app-ss-1

Angular IDE will take a few minutes to set up the project, and you can see the activities output in Terminal+, as shown below:

notetaking-app-ss-2

Adding Angular Material

Once the project is created, we can now install additional node modules to our project. Angular IDE has a terminal view from which we can execute commands. To open the terminal, select Window > Show view > Terminal+. In the opened terminal, type the following commands to install HammerJS, Angular Material and Angular CDK.

add-angular-material

We installed HammerJS because some of the Angular Material components depend on HammerJS for gestures. Modern Angular projects already include the Angular animations module (@angular/animations), but if you happen to be following along with an older version of the CLI or Angular, please install that as well.

Are you ready to modernize your Eclipse experience? ‘Cause DevStyle is here! If you love the brawn of Eclipse, but are underwhelmed with its beauty and usability, then DevStyle is for you. Bringing “Developer Ergonomics” to Eclipse, with an enhanced startup experience, awesome themes, and enhanced functionality within the IDE.

Creating new components

Now, let’s create the components. In the file explorer view, right-click on App, select New and click Component.

notetaking-app-ss-3

In the New Angular CLI dialog, enter quicknotes as element name, and click Finish. See the image below for reference:

notetaking-app-ss-4

A new folder named quicknotes will be added to src/app.  Now open quicknotes.component.ts and replace the default code snippet with the new snippet below:

 

First, we created an array to store our quicknotes, then we added a default quicknotes to our array.  We declared string type variables – titleModel, contentModel, todoModel – to help us add new quicknotes and, finally, we added a new method createQuicknotes().

Importing Forms module

Open your app.module.ts file and add the import form module like the one below:

Now open quicknotes.component.html file and replace the default code snippet with the new snippet below:

Styling

There are default themes used by Google on most of their services that we can use directly. To do so, add the following line to your styles.css file:

 Updating Default Component

Open src/app/app.component.ts file and replace the code snippet with the one below:

Here we have imported quicknotes.component.ts file to app.component.ts file.

Now update app.component.html file with the code snippet below:

Important Notes

  • MaterialModule has been deprecated in favor of defining a project-specific custom material module where you import and export only the needed components. For this tutorial, we have used MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, and MatCardModule.
  • *ngFor is Angular syntax to iterate through the array, ngModel is directive for two-way data binding, (click) is used to add click handler, and two curly braces {{ }} are used to bind values to view or template.
  • Two-way Data Binding has to be one of the most important features in Angular. It is a mechanism to map the data directly from model to view and vice versa.

Running Our App

There is a server view in Angular IDE, as shown in the image below. To open this view, select Window > Show View > Server. Right-click on your project (here quicknotes) and select Start Server. Angular IDE serves the application on localhost port 4200, so open up http://localhost:4200 in your browser to see the running app.

notetaking-app-ss-5

 

Our app will look like this:

notetaking-app-ss-6

 

Connect Your Browser to Your Source Code with CodeLive

Angular IDE has a special feature known as CodeLive that provides a bridge between the IDE and the browser, which speeds up web development. CodeLive shows you the Angular components loaded on your web page. You can then easily jump to the corresponding TypeScript, HTML or CSS file. 

App in Action

Conclusion

We hope this tutorial has given you some new insights into Angular app development. As you can see, the entire process is made much easier by using Angular IDE. Remember, these features are also available in our Webclipse plug-in, or our full-stack offering, MyEclipse IDE.

Related Posts

Building Applications with Angular Material Angular Material is a set of high-quality UI components developed by the Angular team, based on the Google Material design specification. These components help us to build applications with an attractive, yet familiar UI, giving users a consistent experience across devices.In this Angular tutorial, you will learn how to set up material design in yo...
Testing Angular Apps with Jasmine and Karma Testing is one of the most important aspects of the modern application development process. Today, high quality, robust applications are the norm; nobody appreciates a buggy application. This article will walk you through testing your Angular application using capabilities that are already part of your Angular project.Creating a New Angular Project...
Angular 5 Features Front-end developers, rejoice - after a short delay, the Angular 5 release is scheduled for October 23rd!Update (November 1st): It's finally here! After ten release candidates, Angular version 5.0.0, "pentagonal-donut", has been released.Update (October 31st): Well, we're still waiting for Angular version 5, and we're now at 5.0.0 RC 9 - but, I'm s...
Create a Cryptocurrency Dashboard with Angular With Bitcoin’s record-breaking surge past the $7000 mark, we thought this would the perfect time to build a cryptocurrency dashboard with Angular. Cryptocurrency is a digital asset designed to work as a medium of exchange, using cryptography to secure the transactions and to control the creation of additional units of the currency. While Bitcoin is...

Posted on Dec 11th 2017