厌倦了每次我开始一个新的Laravel项目时创建相同的目录并创建相同的文件,对于前面的事情,我决定使用assets
和views
文件夹创建一个Git仓库和里面的一些文件,只是为了让我的结构快速准备好。
This repo can be accessed here(关于这个问题没什么用处,这只是为了清楚我要做什么)
我的想法是在我的Laravel项目中拉出/获取/使用你想要的那个非常回复的术语(当然,这本身就是一个Git回购),就是这样。
非常清楚,步骤将是这样的:
my-new-project
resources
目录我坚持认为我不是在谈论对Git仓库的进一步操作,我真的在谈论一劳永逸地获取内容,然后忘记了Git仓库的存在
resources
子文件夹中)。 这样做的最佳方法/最佳做法是什么?
答案 0 :(得分:0)
这可以通过以下脚本来处理:
在存储库上发布import { Component, OnInit } from '@angular/core';
import {DataSource} from '@angular/cdk';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/map';
@Component({
selector: 'app-admin-products',
templateUrl: './admin-products.component.html',
styleUrls: ['./admin-products.component.css']
})
export class AdminProductsComponent implements OnInit {
curentPage: string;
isDarkTheme: any;
totalProducts: any = 88;
totalNeeds: any = 88;
totalBrands: any = 88;
totalAgeGroups: any = 88;
constructor() {
this.curentPage = 'Products';
this.isDarkTheme = false;
}
ngOnInit() {
}
}
/** Constants used to fill up our data base. */
const COLORS = ['maroon', 'red', 'orange', 'yellow', 'olive', 'green', 'purple',
'fuchsia', 'lime', 'teal', 'aqua', 'blue', 'navy', 'black', 'gray'];
const NAMES = ['Maia', 'Asher', 'Olivia', 'Atticus', 'Amelia', 'Jack',
'Charlotte', 'Theodore', 'Isla', 'Oliver', 'Isabella', 'Jasper',
'Cora', 'Levi', 'Violet', 'Arthur', 'Mia', 'Thomas', 'Elizabeth'];
export interface UserData {
id: string;
name: string;
progress: string;
color: string;
}
/** An example database that the data source uses to retrieve data for the table. */
export class ExampleDatabase {
/** Stream that emits whenever the data has been modified. */
dataChange: BehaviorSubject<UserData[]> = new BehaviorSubject<UserData[]>([]);
get data(): UserData[] { return this.dataChange.value; }
constructor() {
// Fill up the database with 100 users.
for (let i = 0; i < 100; i++) { this.addUser(); }
}
/** Adds a new user to the database. */
addUser() {
const copiedData = this.data.slice();
copiedData.push(this.createNewUser());
this.dataChange.next(copiedData);
}
/** Builds and returns a new User. */
private createNewUser() {
const name =
NAMES[Math.round(Math.random() * (NAMES.length - 1))] + ' ' +
NAMES[Math.round(Math.random() * (NAMES.length - 1))].charAt(0) + '.';
return {
id: (this.data.length + 1).toString(),
name: name,
progress: Math.round(Math.random() * 100).toString(),
color: COLORS[Math.round(Math.random() * (COLORS.length - 1))]
};
}
}
/**
* Data source to provide what data should be rendered in the table. Note that the data source
* can retrieve its data in any way. In this case, the data source is provided a reference
* to a common data base, ExampleDatabase. It is not the data source's responsibility to manage
* the underlying data. Instead, it only needs to take the data and send the table exactly what
* should be rendered.
*/
export class ExampleDataSource extends DataSource<any> {
constructor(private _exampleDatabase: ExampleDatabase) {
super();
}
/** Connect function called by the table to retrieve one stream containing the data to render. */
connect(): Observable<UserData[]> {
return this._exampleDatabase.dataChange;
}
disconnect() {}
}
,然后
删除新创建的for i in json_data[0]:
print (i['name'])
目录中的git clone --depth=1 <url> <destination>
文件夹
因此,您可以从git repo中获取所有内容,而且全部都是。