This suggests there are four default themes:
- deeppurple-amber.css
- indigo-pink.css
- pink-bluegrey.css
- purple-green.css
Include in a CSS file like so:
@import '@angular/material/prebuilt-themes/deeppurple-amber.css';
This suggests there are four default themes:
Include in a CSS file like so:
@import '@angular/material/prebuilt-themes/deeppurple-amber.css';
I think there is a way to do that with lodash, as this suggests...
_.startCase('helloThere');
If you want roll something yourself you can do something like this however my invention can't really account for characters that are not letters. If you want to account for characters that are not letters you would have to check to see if .toUpperCase() and .toLowerCase() off of a character matched up I suppose. My stuff also does not play nice with one letter words like I or A. Anyhow, this will turn this:
export enum Role {
Administrator,
ComplianceGroup,
BusinessUnitSME,
BUAggregator,
ReadOnlyAuditor
}
...into this:
Jest tests are basically like Jasmine/Karma tests except that the "it" leading a test is "test" instead of "it" unless you explicitly use "it" which will work too. There is also the concept of snapshot testing. If a snapshot of a component does not exist you may make one which is some sort of blob of data. Going forward, you may compare the blob created in a test to an existing blob to see if the component (including the template) changed (unexpectedly). There is a command (using the U keyboard key) to update snapshots if you are expecting change instead of being wary of it. This snapshot comparison stuff isn't particularly "code first" but that doesn't mean it is bad either.
The backflips below account for acronyms.
private GetFriendlyRoleName():string {
let betterName:string = "";
if (this.user) {
let spacelessName:string = Role[this.user.Role];
let counter = 0;
while (counter < spacelessName.length){
if(counter > 0){
if (spacelessName.charAt(counter) ==
spacelessName.charAt(counter).toUpperCase()){
if (spacelessName.charAt(counter-1) == spacelessName.charAt(counter-
1).toUpperCase()){
if (counter + 1 < spacelessName.length) {
if (spacelessName.charAt(counter+1) ==
spacelessName.charAt(counter+1).toUpperCase()){
betterName = betterName + spacelessName.charAt(counter);
} else {
betterName = betterName + " " + spacelessName.charAt(counter);
}
} else {
betterName = betterName + spacelessName.charAt(counter);
}
} else {
betterName = betterName + " " + spacelessName.charAt(counter);
}
} else {
betterName = betterName + spacelessName.charAt(counter);
}
} else {
betterName = betterName + spacelessName.charAt(counter);
}
counter++;
}
}
return betterName;
}
We may not really need Yarn anymore. The way it worked its magic was when you ran npm install for the first time and the dependencies in package.json got hydrated to the node_modules folder, a yarn.lock file would get created denoting what specific version, down to the patch, was pulled and what specific server it came from. Of course, both of these things are kind of wishy-washy and, in being subject to change, both of these things can break your app when you get different stuff in a second pass at npm install. If the yarn.lock files exists however, it will be used as guideline to prevent different versions and different servers from being used. In modern times you can do all this without Yarn by getting npm to make a package-lock.json file that does the same trick.