Angular dependency injection principle

Dependency injection is a major feature of Angular, through which you can write more maintainable code. But the JavaScript language itself does not provide the function of dependency injection, so how does Angular implement the function of dependency injection? Read this article and you will find the answer.A typical Angular application, from t ...

Posted by djloc286 on Tue, 25 Jan 2022 21:41:01 +0100

You certainly need to know about developing wechat applet

Write in frontBecause wechat applet claims to solve the compatibility problem of front-end programmers, it only needs to code according to the official set of rules of Tencent to meet different terminal needs. Therefore, in the second half of last year, I realized a project used internally by our company with wechat applet (700 + users at prese ...

Posted by MsShelle on Mon, 24 Jan 2022 17:18:39 +0100

Quickly understand TypeScript classes, Abstract classes, inheritance, polymorphism

Prior to es6, the implementation of JS usage methods or components required the use of functions, prototypes, and prototype chains. The concept of JS classes was introduced in es6, and we can use and build classes based on object-oriented methods using JS. Writing of ES6 classes is also allowed in TS and eventually compiled as JS code allow ...

Posted by schoolmommy on Mon, 24 Jan 2022 11:30:44 +0100

[ES5] overview of new methods - foreach () - filter () - some () - map () - trim () - object defineProperty()

ES5 has added some methods to operate arrays or strings conveniently. These methods mainly include: Array methodString methodObject method 1, Array method Iterative (traversal) methods: forEach, map(), filter(), every() 1.forEach Executes the given function once for each element of the array. 1.1 writing method array.forEach( func ...

Posted by thefisherman on Sat, 22 Jan 2022 14:41:01 +0100

vite + vue3 + setup + pinia + ts project practice

introduce A project developed using vite + vue3 + pinia + ant design Vue + typescript complete technical route, with second level development update launch, new vue3 composition api combined with setup to enjoy smooth development experience, new pinia state manager and excellent design experience (1k size), ant D barrier free transition to UI ...

Posted by zab329 on Fri, 21 Jan 2022 12:52:17 +0100

TypeScript advanced type 2 you need to know (summary)

Type inference: If no type is explicitly specified, TS will infer a type according to the rule of Type Inference: let myFavoriteNumber = 'seven'; //No mistake myFavoriteNumber = 7; //Type 'number' is not assignable to type 'string'. Note: different from declaring no assignment, declaring no assignment will be set to any ...

Posted by rndilger on Thu, 20 Jan 2022 06:06:48 +0100

TS learning notes

1, Data types in Ts Before introducing data types, first explain the declaration and assignment methods in ts. 1) Declare first and assign value when necessary: let c:number; c=5 2) Direct assignment after declaration let c:boolean = true; 3) After direct assignment, the variable type defaults to the type at the first assignment an ...

Posted by donbre on Tue, 18 Jan 2022 10:12:03 +0100

Advanced TypeScript types you need to know (summary)

preface For students with JavaScript foundation, it is actually easy to get started with TypeScript. You can gradually transition from JS application to TS application by simply mastering its basic type system. // js const double = (num) => 2 * num // ts const double = (num: number): number => 2 * num However, when the application b ...

Posted by sylesia on Tue, 18 Jan 2022 06:33:29 +0100

Learned Vue defineAsyncComponent Api, which taught me this knowledge?

Author: Apoorv Tyagi Translator: front end Xiaozhi Source: dev There are dreams and dry goods. Wechat search [Daqian world] pays attention to this bowl washing wisdom who is still washing dishes in the early morning. This article GitHub https://github.com/qq449245884/xiaozhi It has been included. There are complete test sites, materials ...

Posted by PHP_PhREEEk on Mon, 17 Jan 2022 21:48:03 +0100

Type annotation for TypeScript -- (TypeScript 02)

Type annotation in TS Basic type: boolean string number null undefined symbol any neverObjects: interfaceArray: number[] string[] boolean []Writing method of generic type: array < number > New syntax features brought by TS as assertionClass (three object-oriented features of OOP): encapsulation, inheritance and polymorphism There are o ...

Posted by shai1 on Mon, 17 Jan 2022 13:52:07 +0100