You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tp_ReactNative/JokesApp/model/CategorieFactory.ts

12 lines
365 B

import {Categorie} from "./Categorie";
export class CategorieFactory {
public static createCategories(jsonArray: string): Categorie[] {
let array = [];
let json = JSON.parse(jsonArray);
json.forEach(function (categorie) {
array.push(new Categorie(categorie.name, categorie.number));
});
return array;
}
}