This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerList extends React.Component { | |
constructor(props){ | |
super(props) | |
this.state = { | |
customers: [] | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"start": "PORT=3001 react-scripts start", | |
"start:production": "npm run build && npm run start:prod", | |
"start:prod": "NODE_ENV=production node server", | |
"build": "react-scripts build", | |
"test": "react-scripts test --env=jsdom", | |
"eject": "react-scripts eject" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
/** | |
* Application configuration section | |
* http://pm2.keymetrics.io/docs/usage/application-declaration/ | |
*/ | |
apps : [ | |
{ | |
name : 'my_react_app', | |
script : 'npm', | |
args : 'run start:production', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import { | |
BrowserRouter as Router, | |
Route | |
} from 'react-router-dom'; | |
class Home extends Component { | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// abbreviated | |
'default' => env('DB_CONNECTION', 'pgsql'), | |
'connections' => [ | |
'pgsql' => [ | |
'driver' => 'pgsql', | |
'host' => env('DB_HOST', '127.0.0.1'), | |
'port' => env('DB_PORT', '5432'), | |
'database' => env('DB_DATABASE', 'forge'), | |
'username' => env('DB_USERNAME', 'forge'), | |
'password' => env('DB_PASSWORD', ''), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 id="myHeader">My Header</h1> | |
<ul id="myList"> | |
<li>My Item #1</li> | |
<li>My Item #1</li> | |
<li>My Item #1</li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// my.e2e-spec.ts | |
import { $, $$ } from 'protractor'; | |
describe('MyDOM', ()=> { | |
it('should have a header with my text', () => { | |
expect($('h1.myHeader').getText()).toBe('My Header'); | |
}); | |
it('should have 3 list items', () => { | |
expect($$('#myList li').count()).toEqual(3)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"ng": "ng", | |
"heroku-prebuild": "npm install -g http-server", | |
"heroku-postbuild": "ng build --prod", | |
"start": "http-server dist/", | |
"build": "ng build", | |
"test": "ng test", | |
"lint": "ng lint", | |
"e2e": "ng e2e" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pipes/truncate.pipe.ts | |
import { Pipe, PipeTransform } from '@angular/core'; | |
import * as _ from 'lodash'; | |
@Pipe({ name: 'truncate' }) | |
export class TruncatePipe implements PipeTransform { | |
transform(value: string, chars?: number): string { | |
let length = chars ? chars : 100; | |
return _.truncate(value, {length: length }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, ViewChild } from '@angular/core'; | |
import { LazyLoadEvent, DataTable } from 'primeng/primeng'; | |
import { Router, ActivatedRoute } from '@angular/router'; | |
// component | |
declare var jQuery: any; | |
params = {page: 1, page_size: 10}; | |
paginator = {total_records: 0, per_page: 10, total_pages: 0, current_page: 1}; |
NewerOlder