xyzdata / Angular2017

Angular2017: Angular 2 & Angular 4 & Angular 2017+
MIT License
0 stars 0 forks source link

Angular 2017 #1

Open xyzdata opened 6 years ago

xyzdata commented 6 years ago

Angular2017

Angular 2

https://app.pluralsight.com/library/courses/angular-2-first-look/

https://app.pluralsight.com/library/courses/angular-2-first-look/transcript https://app.pluralsight.com/library/courses/angular-2-first-look/exercise-files

https://app.pluralsight.com/library/courses/angular-2-first-look/discussion

https://app.pluralsight.com/library/courses/angular-2-first-look/learning-check https://app.pluralsight.com/score/learning-check/angular-2-first-look/next

https://app.pluralsight.com/library/courses/angular-2-first-look/recommended-courses

xyzdata commented 6 years ago

codes

https://github.com/johnpapa

https://github.com/johnpapa/ng-demos

https://github.com/johnpapa/angular-tour-of-heroes

https://github.com/johnpapa/angular-first-look-hosted

https://github.com/johnpapa/angular-first-look-examples

xyzdata commented 6 years ago

SEO

https://www.hotjar.com/pricing

x-amz-security-token=

https://user-assets-unbounce-com.s3.amazonaws.com/c90176f1-28f8-4c16-8ff0-836116795f02/d007a7c6-3ffd-4515-a9d2-f8f78196b258/hotjar-action-plan.original.pdf

https://user-assets-unbounce-com.s3.amazonaws.com/c90176f1-28f8-4c16-8ff0-836116795f02/d007a7c6-3ffd-4515-a9d2-f8f78196b258/hotjar-action-plan.original.pdf?x-amz-security-token=FQoDYXdzED4aDLnkcYtvqIAynQwsvSLBA2VUdKYCRANFSXgsizLJCHa4vGS11Vy65LQQF92nbRzHpeRD3REV6ZQuOltzMl5g5RiUUf9cE5P04BW6QK3xllD2oDcN1UYc%2BKYt%2Fn1LlJf0Ypo1bP%2FJbrvdBecgAbKezk7dsMEkKtrum84NPaarkvNOOrzlgDW6VsaxRLHalObmSGIfuANIyf3WOwyFmFcREq%2BYeJfVjMZ0P840RPc26okUr8QjmuPK1e22xidPUWMPnNHN8P3kgvV9HGrV6OaM1ubJp0TEqU0TvNt%2BZWK8PSo3BXbbhCN9wRwMC7SNLR78vMRymEccYTfJ3rG4MdXQMgkU6Qzp9DKx1rZTpIYOLSr7JCqbLW%2FJByaUxokMFeBRzhsf1i9zfVYU5CnPWCtJyuSLqC9ZA1V84o%2FJLsSwhbJCm3MYZj110fkLnxIPEmsWw2%2FtMo0CVf719L3YSsp82PMXRWlF3Ba%2FjYyShaQht9vJpMaQ0MnU05oFZgEWPTbDGd%2BAH0gyn9w2oIxg%2FXQwiwT4PzGjxxxiBrcX%2FhL6xrHb5OYXDmeogjCXNYcSeZNxVFpudMymsUTjlHgYz1%2FyGOtlrJrxKMNIwVTNLbidXnymKPyTos4F&AWSAccessKeyId=ASIAIZSMOT5HBQONH73A&Expires=1506316699&Signature=XTdSZcBNBd8jcy3vwfeGv8yJWtA%3D

xyzdata commented 6 years ago

GraphQL

https://github.com/gildata/graphql-js/issues/1

xyzdata commented 6 years ago

Date.prototype.format = function (format) {
    /*
     * format="yyyy-MM-dd hh:mm:ss";
     */
    // this = object self
    var o = {
        "M+": this.getMonth() + 1,
        "d+": this.getDate(),
        "h+": this.getHours(),
        "m+": this.getMinutes(),
        "s+": this.getSeconds(),
        "q+": Math.floor((this.getMonth() + 3) / 3),
        "S": this.getMilliseconds()
    };
    // Regex Group
    if (/(y+)/.test(format)) {
        // RegExp.$1 & replace
        format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    for (var k in o) {
        if (new RegExp("(" + k + ")").test(format)) {
            format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
        }
    }
    return format;
};

/* 

const date = new Date();
const f = "yyyy-MM-dd hh:mm:ss";

f.replace($1, date.getFullYear());
// "2017-MM-dd hh:mm:ss"

// 分组(Grouping)与反向引用(back references)
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references

//RegExp.$1-$9
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/n

var re = /(\w+)\s(\w+)/;

var str = 'John Smith';
str.replace(re, '$2, $1'); // "Smith, John"

RegExp.$1; // "John"
RegExp.$2; // "Smith"

f = "yyyy-MM-dd hh:mm:ss";

r = /(\w+)\-(\w+)/;

f.replace(r, '$2, $1');
// "MM, yyyy-dd hh:mm:ss"

f.replace(r, '$1, $2, $3, $4');
// "yyyy, MM, $3, $4-dd hh:mm:ss"

RegExp();
// /(?:)/

/(y+)/.test(f);
// true

RegExp.$1
// "yyyy"
RegExp.$2
""

/(y+)/.test(f);
true
f.replace(`$1`, `2017`);
"yyyy-MM-dd hh:mm:ss"

/(y+)/.test(f);
true
f.replace(`${RegExp.$1}`, `2017`);
"2017-MM-dd hh:mm:ss"

/(y+)/.test(f);
true
f.replace(`${$1}`, `2017`);
"yyyy-MM-dd hh:mm:ss"

// RegExp.lastMatch ($&)
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastMatch

// RegExp.lastParen ($+)
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastParen

// RegExp.leftContext ($`)
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/leftContext

// RegExp.rightContext ($')
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp/rightContext

*/

const format = `yyyy-MM-dd hh:mm:ss`;

const date = new Date();
// Tue Sep 26 2017 19:58:34 GMT+0800 (中国标准时间)
date.format(`yyyy-MM-dd hh:mm:ss`);
// "2017-09-26 19:58:34"
date.format(`yyyy-MM-dd`);
// "2017-09-26"
date.format(`yyyy-MM-dd   `);
// "2017-09-26   "
xyzdata commented 6 years ago

https://opensource.org/licenses/MIT