注解
@injectable
@injectable 一般用在Angular的Service中,
他的意思是该Service实例可以注入到其他的service、component或者其他实例里面。
@Injectable({ providedIn: ‘root’, })代表这个类将被注入到根module中,也就是说该module中被注入了唯一的MockService实例。
json
Json.stringify(model) 将model转换成json
JSON.parse(json串); 将json转换成model
angular函数
// 截取,包头不包尾
slice(start?: number, end?: number): string;
// 返回一个新的数组。该数组是通过把所有 arrayX 参数添加到 arrayObject 中生成的。
// 如果要进行 concat() 操作的参数是数组,那么添加的是数组中的元素,而不是数组。
concat(...items: ReadonlyArray<T>[]): T[];