Coder Social home page Coder Social logo

state-district-maintainance's Introduction

State & District Maintainance

A webpage to maintain state & district using HTML, CSS and Angular

Components overview

App components:

  • <app-root>: The root component which angular includes by default in index.html
    • <app-header>: This is the heading of the page cotaining the title- "State & District Maintainance"
    • <app-state-view>: This provides the interface to view states from a dropdown menu. It has two child components:
      • <app-state-adder>: On clicking the Add New button, this component appears showing an input box, ✔️ (add button) and ❌ (cancel button).
        Add a new state into the states list using this component.
      • <app-district-view>: To view districts under the selected state. Has one child component:
        • <app-district-adder>: Same as <app-state-adder>, but adds a district under the selected state from input box.

state-district.service

The states and districts in the app are provided by the state-district service. The app is just a frontend so it stores the state & districts in STATES array- a property of the state-district service.

State and District are implemented in place.ts:

export interface State {
    id: number;
    name: string;
    districts: District[];
}

export interface District {
    id: number;
    name: string;
}

Properties:

  • STATES: State[]: An array of State. States and districts in the app are provided from here.

Methods:

  • getStates(): Returns the STATES array.
  • addState(stateName: string): Creates a newState provided the name of the state and appends to the STATES array.
  • getDistricts(stateId: number): Returns the list of districts under a state provided the stateId.
  • addDistrict(stateId: number, districtName: string): Creates a district using the districtName provided and appends to the list of districts under the state having id of stateId.

Reference

Interfaces

Services

Components

state-district-maintainance's People

Contributors

tripathics avatar

Watchers

 avatar

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.