Category Archives: Angularjs

How to Create component and services in angularjs

Create Component —————-

here dashboard component will be created with folder dashboard.So inside Dashboard folder following files will be available src/app/dashboard/dashboard.component.html src/app/dashboard/dashboard.component.ts Service,Guards Creation —————- here authentication guard service is created using the following commands

it will generate the following two files inside services,guards folders src/app/services/authentication.ts src/app/guards/authentication.guard.ts

Angularjs error:has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource

When i m trying to access nodejs api using angular its throwing this error Solution:

Error:Unhandled Promise rejection: Template parse errors:ngIf usage in angularjs2

Unhandled Promise rejection: Template parse errors: Can’t bind to ‘ngif’ since it isn’t a known property of ‘div I m getting the above error while execute my angular js code.

usulay this error will throw due invalid syntax.here small letter is used in the if(ngif).if you change to ngIf it will works fine.

unhandled Promise rejection: Failed to load

In the Following angular js code i m getting the below error unhandled Promise rejection: Failed to load app.test.html ; Zone: ; Task: Promise.then ; Value: Failed to load app.test.html undefined my code looks like below

Solution:This issue because of wrong syntax. use templateUrl: ‘app/test.html’ instead of templateUrl: ‘app.test.html’.

Create table list using angularjs and json

How to display a table list as grid with few details like Name,State,Designation.Below code snippet contains the angualarjs code to display the data.

tsc not found error in ubuntu while executing npm start command

For executing angular js application we need to execute the command npm start. while executing this command in ubuntu i m getting the error “tsc not found”. you can fix the issue using the below commands sudo npm install -g tsc sudo npm install -g concurrently sudo npm install -g typescript sudo npm install npm… Read More »

Automatic dropdown box loading using angularjs

Populate a dropdown2 based on dropdown1 Here i am explaining the code for loading a state dropdown using country dropdown using angularjs and php. Step1:create a database mytest_data and create 2 tables tbl_country and tbl_state. here country table is associated with state table using country_id.

create the tables using the above code. Step2:create two… Read More »

Dynamic Dropdown list using AngularJS with PHP

Below code explains how to dynamically load a dropdown using angular js.and while selecting a particular employee name from the dropdown it will display the details of the employee. Step1: create database in mysql with name mytest_data. create a table tbl_employee

step2: create a php file called loaddata.php to fetch the employee details from… Read More »