Skip to content

Commit 7bfe62a

Browse files
thanhtruong34devversion
authored andcommitted
docs: add deferrable views tutorial (angular#57934)
Add a new tutorial "Deferrable Views" to the tutorials page. PR Close angular#57934
1 parent bb46b6b commit 7bfe62a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+7362
-0
lines changed

adev/src/app/sub-navigation-data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {NavigationItem} from '@angular/docs';
1111
// These 2 imports are expected to be red because they are generated a build time
1212
import FIRST_APP_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/first-app/routes.json';
1313
import LEARN_ANGULAR_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/learn-angular/routes.json';
14+
import DEFERRABLE_VIEWS_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/deferrable-views/routes.json';
1415

1516
import {DefaultPage} from './core/enums/pages';
1617
import {getApiNavigationItems} from './features/references/helpers/manifest.helper';
@@ -872,6 +873,7 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [
872873
export const TUTORIALS_SUB_NAVIGATION_DATA: NavigationItem[] = [
873874
FIRST_APP_TUTORIAL_NAV_DATA,
874875
LEARN_ANGULAR_TUTORIAL_NAV_DATA,
876+
DEFERRABLE_VIEWS_TUTORIAL_NAV_DATA,
875877
{
876878
path: DefaultPage.TUTORIALS,
877879
contentPath: 'tutorials/home',

adev/src/assets/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ copy_to_directory(
3737
"//adev/src/content/tools/cli",
3838
"//adev/src/content/tools/libraries",
3939
"//adev/src/content/tutorials",
40+
"//adev/src/content/tutorials/deferrable-views:deferrable-views-guides",
4041
"//adev/src/content/tutorials/first-app:first-app-guides",
4142
"//adev/src/content/tutorials/learn-angular:learn-angular-guides",
4243
"//packages/animations:animations_docs",
@@ -84,6 +85,7 @@ copy_to_directory(
8485
copy_to_directory(
8586
name = "tutorials",
8687
srcs = [
88+
"//adev/src/content/tutorials/deferrable-views",
8789
"//adev/src/content/tutorials/first-app",
8890
"//adev/src/content/tutorials/homepage",
8991
"//adev/src/content/tutorials/learn-angular",
Lines changed: 107 additions & 0 deletions
Loading

adev/src/content/tutorials/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ generate_guides(
1111
],
1212
),
1313
data = [
14+
"//adev/src/assets/images:ang_illustrations-04.svg",
1415
"//adev/src/assets/images:learn-angular-browser.svg",
1516
"//adev/src/assets/images:learn-angular-local.svg",
1617
],
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
load("//adev/shared-docs:index.bzl", "generate_guides", "generate_tutorial")
2+
3+
package(default_visibility = ["//adev:__subpackages__"])
4+
5+
generate_guides(
6+
name = "deferrable-views-guides",
7+
srcs = glob(["**/*.md"]),
8+
)
9+
10+
filegroup(
11+
name = "files",
12+
srcs = glob(
13+
["**/*"],
14+
exclude = ["**/*.md"],
15+
),
16+
)
17+
18+
generate_tutorial(
19+
name = "deferrable-views",
20+
tutorial_srcs = ":files",
21+
)
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"first-app": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"inlineTemplate": true,
11+
"inlineStyle": true,
12+
"style": "scss",
13+
"skipTests": true
14+
},
15+
"@schematics/angular:class": {
16+
"skipTests": true
17+
},
18+
"@schematics/angular:directive": {
19+
"skipTests": true
20+
},
21+
"@schematics/angular:guard": {
22+
"skipTests": true
23+
},
24+
"@schematics/angular:interceptor": {
25+
"skipTests": true
26+
},
27+
"@schematics/angular:pipe": {
28+
"skipTests": true
29+
},
30+
"@schematics/angular:resolver": {
31+
"skipTests": true
32+
},
33+
"@schematics/angular:service": {
34+
"skipTests": true
35+
}
36+
},
37+
"root": "",
38+
"sourceRoot": "src",
39+
"prefix": "app",
40+
"architect": {
41+
"build": {
42+
"builder": "@angular/build:application",
43+
"options": {
44+
"outputPath": "dist/first-app",
45+
"index": "src/index.html",
46+
"browser": "src/main.ts",
47+
"polyfills": ["zone.js"],
48+
"tsConfig": "tsconfig.app.json",
49+
"inlineStyleLanguage": "scss",
50+
"assets": [
51+
{
52+
"glob": "**/*",
53+
"input": "src/public"
54+
}
55+
],
56+
"styles": ["src/styles.css"],
57+
"scripts": []
58+
},
59+
"configurations": {
60+
"production": {
61+
"budgets": [
62+
{
63+
"type": "initial",
64+
"maximumWarning": "500kB",
65+
"maximumError": "1MB"
66+
},
67+
{
68+
"type": "anyComponentStyle",
69+
"maximumWarning": "2kB",
70+
"maximumError": "4kB"
71+
}
72+
],
73+
"outputHashing": "all"
74+
},
75+
"development": {
76+
"optimization": false,
77+
"extractLicenses": false,
78+
"sourceMap": true
79+
}
80+
},
81+
"defaultConfiguration": "production"
82+
},
83+
"serve": {
84+
"builder": "@angular/build:dev-server",
85+
"configurations": {
86+
"production": {
87+
"buildTarget": "first-app:build:production"
88+
},
89+
"development": {
90+
"buildTarget": "first-app:build:development"
91+
}
92+
},
93+
"defaultConfiguration": "development"
94+
},
95+
"extract-i18n": {
96+
"builder": "@angular/build:extract-i18n"
97+
}
98+
}
99+
}
100+
}
101+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# To learn more about how to use Nix to configure your environment
2+
# see: https://developers.google.com/idx/guides/customize-idx-env
3+
{ pkgs, ... }: {
4+
# Which nixpkgs channel to use.
5+
channel = "stable-23.11"; # or "unstable"
6+
# Use https://search.nixos.org/packages to find packages
7+
packages = [
8+
pkgs.nodejs_18
9+
];
10+
# Sets environment variables in the workspace
11+
env = {};
12+
idx = {
13+
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
14+
extensions = [
15+
"angular.ng-template"
16+
];
17+
workspace = {
18+
# Runs when a workspace is first created with this \`dev.nix\` file
19+
onCreate = {
20+
npm-install = "npm install --no-audit --prefer-offline";
21+
};
22+
# To run something each time the environment is rebuilt, use the \`onStart\` hook
23+
};
24+
# Enable previews and customize configuration
25+
previews = {
26+
enable = true;
27+
previews = {
28+
web = {
29+
command = ["npm" "run" "start" "--" "--port" "$PORT" "--host" "0.0.0.0"];
30+
manager = "web";
31+
};
32+
};
33+
};
34+
};
35+
}

0 commit comments

Comments
 (0)