Posts

angular basic commands

The version of npm is 3.10.10. Now that we have nodejs and npm installed, let us run the angular cli commands to install Angular 4. You will see the following commands on the webpage − npm install -g @angular/cli //command to install angular 4 ng new Angular 4-app // name of the project cd my-dream-app ng serve Let us start with the first command in the command line and see how it works. To start with, we will create an empty directory wherein, we will run the Angular CLI command. We have now installed Angular 4. Let us now create our first project in Angular 4. To create a project in Angular 4, we will use the following command − ng new projectname We will name the project  ng new Angular 4-app . Now that we have the file structure for our project, let us compile our project with the following command − ng serve The  ng serve  command builds the application and starts the web server. The web server starts on port 4200. Type the url  http://l...

Getting distinct rows from table with count

<?php $result =  $this->db->query("SELECT ticket_code,COUNT(*) as count FROM total_tickets_private GROUP BY ticket_code ORDER BY count DESC;")->result();   <td><?=$res->ticket_code ?></td>     <td><?=$res->count ?></td> ?>
Remember, you’ll need to do an npm install on each project to install the dependencies and get it working. Sometimes you may also need to re-install the CLI using the following two commands: npm uninstall --save-dev angular-cli npm install --save-dev @angular/cli@latest And sometimes you may get the “Environment configuration does not contain environment Source entry” error. This is fixed by editing the file angular-cli.json and changing the setting from this "environments": {  "source": "environments/environment.ts",  "dev": "environments/environment.ts",  "prod": "environments/environment.prod.ts" } to this: "environmentSource": "environments/environment.ts", "environments": {  "dev": "environments/environment.ts",  "prod": "environments/environment.prod.ts" } Angular and Naming The purpose of AngularJS and Angular 4 is to cr...

Introduction

Disclaimer Let’s get this over with as quickly as possible. I need to mention two things. First, some of the information in this book may be incorrect (I’m a human being that makes mistakes). Also, this book is somewhat opinionated. I have tried my best to be as technically accurate as possible, but I’m still learning a lot and have much yet to learn about Angular 4. I do have some strong opinions, but please don’t take them as gospel. I don’t intend to harm anything or anyone—I’m not smart enough for that. Scope This scope of this book is to help developers get started in Angular 4. You’re not going to read and learn all there is to know about Angular54. That’s not the purpose of this book; getting up to speed as a developer is. In my opinion, getting up to speed means having a good overall knowledge—sufficient to start working. Approach This book contains chapters with small code examples built with the Angular CLI. You’ll be able to try out code without being burden...