Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
[![Made in Tanzania](https://img.shields.io/badge/made%20in-tanzania-008751.svg?style=flat-square)](https://github.com/Tanzania-Developers-Community/made-in-tanzania)
This library provides an Angular service to get all locations
npm install ngx-mitaa
Or if you use yarn
yarn add ngx-mitaa
Import the service in your component where you want to use it
import { NgxMitaaService } from 'ngx-mitaa';
Inject the service in your component's constructor or using inject function
constructor(private ngxMitaaService: NgxMitaaService) {}
// or
const ngxMitaaService = inject(NgxMitaaService);
// Get all locations
const locations = this.ngxMitaaService.getLocations();
This will return an array of objects with the following structure;
[
{
continent: 'Africa',
countries: [
{
country: 'Tanzania',
regions: [
{
region: 'Dar es Salaam',
districts: [
{
district: 'Ilala Cbd',
wards: [
{
ward: 'Kivukoni',
streets: ['Kivukoni', 'Sea View'],
},
{
ward: 'Upanga Mashariki',
streets: ['Kitonga', 'Kibasila'],
},
],
},
],
},
],
},
],
},
];
// Get all continents
const continents = this.ngxMitaaService.getContinents();
This will return an array of strings with the following structure;
[
'Africa',
'Antarctica',
'Asia',
'Australia',
'Europe',
'North America',
'South America',
];
// Get all countries by continent(defaults to Africa)
const countries = this.ngxMitaaService.getCountries('Africa');
This will return an array of strings with the following structure;
["Tanzania", "Burundi", "Kenya", , "Rwanda", "South Sudan", "Uganda" ...];
// Get all regions by country(default to Tanzania) and continent(defaults to Africa)
const regions = this.ngxMitaaService.getRegions('Tanzania', 'Africa');
This will return an array of strings with the following structure;
[
"Dar es Salaam",
"Dodoma",
"Iringa",
"Kagera",
"Kigoma",
"Kilimanjaro",
"Lindi",
"Manyara",
"Mara",
"Mbeya",
...
];
// Get all districts by region(defaults to Dar es Salaam), country(defaults to Tanzania) and continent(defaults to Africa)
const districts = this.ngxMitaaService.getDistricts(
'Dar es Salaam',
'Tanzania',
'Africa'
);
This will return an array of strings with the following structure;
[
"Ilala Cbd",
"Kinondoni",
"Kigamboni",
"Temeke",
"Ubungo",
"Kurasini",
"Kigamboni",
"Kigamboni",
"Kigamboni",
"Kigamboni",
...
];
// Get all wards by district(defaults to Kinondoni), region(defaults to Dar es Salaam), country(defaults to Tanzania) and continent(defaults to Africa)
const wards = this.ngxMitaaService.getWards(
'Kinondoni',
'Dar es Salaam',
'Tanzania',
'Africa'
);
This will return an array of strings with the following structure;
[
"Bunju",
"Hananasif",
"Kawe",
"Kigogo",
"Kijitonyama",
"Kinondoni",
"Kunduchi",
"Mabwepande",
"Magomeni",
...
];
// Get all streets by ward(defaults to Magomeni), district(defaults to Kinondoni), region(defaults to Dar es Salaam), country(defaults to Tanzania) and continent(defaults to Africa)
const streets = this.ngxMitaaService.getStreets(
'Magomeni',
'Kinondoni',
'Dar es Salaam',
'Tanzania',
'Africa'
);
``;
This will return an array of strings with the following structure;
["Dossi", "Idrisa", "Makuti A", "Makuti B", "Suna" ...];
interface Continent {
continent: string;
countries: Country[];
}
interface Country {
country: string;
regions: Region[];
}
interface Region {
region: string;
districts: District[];
}
interface District {
district: string;
wards: Ward[];
}
interface Ward {
ward: string;
streets: string[];
}
All interfaces can be imported from the library
import { Continent, Country, Region, District, Ward } from 'ngx-mitaa';
If you find this library useful, give it a star so that other deveopers can get to know about it.
All the location I used to build this repository, I got from an public repository titled tanzania-locations-db, I'm not responsible for any kind of misinformation in it, I tried to locate my home with it found its pretty accurate, so use it to your own risk
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
FAQs
[![Made in Tanzania](https://img.shields.io/badge/made%20in-tanzania-008751.svg?style=flat-square)](https://github.com/Tanzania-Developers-Community/made-in-tanzania)
The npm package ngx-mitaa receives a total of 12 weekly downloads. As such, ngx-mitaa popularity was classified as not popular.
We found that ngx-mitaa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.