create-analog 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template-angular-v15/src/app/pages/index.page.ts +62 -0
- package/template-angular-v15/src/main.providers.ts +6 -0
- package/template-angular-v15/src/main.server.ts +2 -1
- package/template-angular-v15/src/main.ts +2 -1
- package/template-angular-v15/tsconfig.app.json +5 -1
package/package.json
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-home',
|
|
5
|
+
standalone: true,
|
|
6
|
+
template: `
|
|
7
|
+
<div>
|
|
8
|
+
<a href="https://vitejs.dev" target="_blank">
|
|
9
|
+
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://angular.io/" target="_blank">
|
|
12
|
+
<img
|
|
13
|
+
alt="Angular Logo"
|
|
14
|
+
class="logo angular"
|
|
15
|
+
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
|
|
16
|
+
/>
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<h1>Vite + Angular</h1>
|
|
21
|
+
|
|
22
|
+
<div class="card">
|
|
23
|
+
<button type="button" (click)="increment()">Count {{ count }}</button>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<p>
|
|
27
|
+
Check out
|
|
28
|
+
<a href="https://github.com/analogjs/analog#readme" target="_blank"
|
|
29
|
+
>Analog</a
|
|
30
|
+
>, the fullstack meta-framework for Angular powered by Vite!
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<p class="read-the-docs">
|
|
34
|
+
Click on the Vite and Angular logos to learn more.
|
|
35
|
+
</p>
|
|
36
|
+
`,
|
|
37
|
+
styles: [
|
|
38
|
+
`
|
|
39
|
+
.logo {
|
|
40
|
+
height: 6em;
|
|
41
|
+
padding: 1.5em;
|
|
42
|
+
will-change: filter;
|
|
43
|
+
}
|
|
44
|
+
.logo:hover {
|
|
45
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
46
|
+
}
|
|
47
|
+
.logo.angular:hover {
|
|
48
|
+
filter: drop-shadow(0 0 2em #42b883aa);
|
|
49
|
+
}
|
|
50
|
+
.read-the-docs {
|
|
51
|
+
color: #888;
|
|
52
|
+
}
|
|
53
|
+
`,
|
|
54
|
+
],
|
|
55
|
+
})
|
|
56
|
+
export default class HomeComponent {
|
|
57
|
+
count = 0;
|
|
58
|
+
|
|
59
|
+
increment() {
|
|
60
|
+
this.count++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -5,6 +5,7 @@ import { provideFileRouter } from '@analogjs/router';
|
|
|
5
5
|
import { withEnabledBlockingInitialNavigation } from '@angular/router';
|
|
6
6
|
|
|
7
7
|
import { AppComponent } from './app/app.component';
|
|
8
|
+
import { mainProviders } from './main.providers';
|
|
8
9
|
|
|
9
10
|
if (import.meta.env.PROD) {
|
|
10
11
|
enableProdMode();
|
|
@@ -15,7 +16,7 @@ export default async function render(url: string, document: string) {
|
|
|
15
16
|
appId: 'analog-app',
|
|
16
17
|
document,
|
|
17
18
|
url,
|
|
18
|
-
providers: [provideFileRouter(withEnabledBlockingInitialNavigation())],
|
|
19
|
+
providers: [provideFileRouter(withEnabledBlockingInitialNavigation()), ...mainProviders],
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
return html;
|
|
@@ -3,7 +3,8 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
|
|
3
3
|
import { provideFileRouter } from '@analogjs/router';
|
|
4
4
|
|
|
5
5
|
import { AppComponent } from './app/app.component';
|
|
6
|
+
import { mainProviders } from './main.providers';
|
|
6
7
|
|
|
7
8
|
bootstrapApplication(AppComponent, {
|
|
8
|
-
providers: [provideFileRouter()],
|
|
9
|
+
providers: [provideFileRouter(), ...mainProviders],
|
|
9
10
|
});
|