📅  最后修改于: 2022-03-11 15:01:45.106000             🧑  作者: Mango
import { Component } from '@angular/core';
selector: 'my-app',
styleUrls: [ './app.component.css' ]
export class AppComponent {
name = 'Angular';
myArray = [1, 2, 3, 4, 5, 6];
addNew(){
myArray. push(this. myArray. length + 1);