GithubHelp home page GithubHelp logo

amilaweerasinghe / angular-ecommerce-application Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 73 KB

Created with StackBlitz ⚡️

Home Page: https://stackblitz.com/edit/angular-gqraaq

CSS 16.25% HTML 17.61% TypeScript 66.14%

angular-ecommerce-application's Introduction

angular-gqraaq

Edit on StackBlitz ⚡️

1.five common features of Angular's template syntax:

*ngFor

*ngIf

Interpolation {{ }}

Property binding [ ]

Event binding ( )

2.Components

A component consists of three things:

A component class that handles data and functionality. In the previous section, the product data and the share() method in the component class handle data and functionality, respectively.

An HTML template that determines the UI. In the previous section, the product list's HTML template displays the name, description, and a "Share" button for each product.

Component-specific styles that define the look and feel. Though product list does not define any styles, this is where component CSS resides.

input using component @Input()

Output using component @output() event binding to call the notify.emit() method. For output events Recall that it's the parent, product list component—not the product alerts component—that acts when the child raises the event. (Choose the parent that acts when the event occurs)

I've learned about the foundation of Angular: components and template syntax. I've also learned how the component class and template interact, and how components communicate with each other.Successfully completed

3.Routing

Angular router enables you to show different components and data to the user based on where the user is in the application. The router enables navigation from one view to the next as users perform application tasks:

Steps Generate component

Add router path in app.module.ts

Add router link

The routerLink defines how the user navigates to the route (or URL) declaratively in the component template.

4.Using route information

inject the ActivatedRoute into the constructor.

The ActivatedRoute is specific to each routed component loaded by the Angular Router. It contains information about the route, its parameters, and additional data associated with the route.

Angular calls ngOnInit() shortly after creating a component.

The route parameters correspond to the path variables defined in the route. The productId is provided from the URL that was matched to the route. You use the productId to display the details for each unique product.

Managing Data

1.Services

In Angular, a service is an instance of a class that can be made available to any part of your application using Angular's dependency injection system.

Services are the place where you share data between parts of your application. For the online store, the cart service is where you store your cart data and methods.

Create Cart Service

Use Cart Service

Retrieve shipping prices

HTTP CLient

The Angular HTTP client (HttpClient) is a built-in way to fetch data from external APIs and provide them to your application as a stream

HTTP client to retrieve shipping prices from an external file.

Forms

Deploy the completed app oon Firebase successfully

angular-ecommerce-application's People

Contributors

amilaweerasinghe avatar

Watchers

James Cloos avatar  avatar

Forkers

archanadae

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.