-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@angular/cli): adds --animation flag to ng new
- Loading branch information
Showing
11 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
packages/@angular/cli/blueprints/ng/files/__path__/app/app-fade-in.animation.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { trigger, state, style, animate, transition } from '@angular/animations'; | ||
|
||
export function AppFadeInAnimationTrigger() { | ||
return trigger('appFadeInAnimation', [ | ||
state('void', style({ | ||
opacity: '0' | ||
})), | ||
state('*', style({ | ||
opacity: '1' | ||
})), | ||
transition('void <=> *', animate('5000ms ease')) | ||
]); | ||
} | ||
|
||
export const AppFadeInAnimation = AppFadeInAnimationTrigger(); |
2 changes: 1 addition & 1 deletion
2
packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h1> | ||
<h1<% if(animation) { %> @appFadeInAnimation <% } %>> | ||
{{title}} | ||
</h1><% if (routing) { %> | ||
<router-outlet></router-outlet><% } %> |
12 changes: 10 additions & 2 deletions
12
packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.spec.ts
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
8 changes: 5 additions & 3 deletions
8
packages/@angular/cli/blueprints/ng/files/__path__/app/app.component.ts
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {ng} from '../../../utils/process'; | ||
import {createProject} from '../../../utils/project'; | ||
|
||
|
||
export default function() { | ||
return Promise.resolve() | ||
.then(() => createProject('animation-project', '--animation')) | ||
|
||
// Try to run the unit tests. | ||
.then(() => ng('test', '--single-run')); | ||
} |