### Run Hugo server locally
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Starts the local Hugo development server from the repo root. Requires an extended version of Hugo.
```bash
hugo server
```
--------------------------------
### Install PostCSS with npm install
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Required for SCSS edits and publishing. Run after adjusting Hugo module settings.
```bash
npm install
```
--------------------------------
### Clone template repository with git clone
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Creates a local working copy of the new project from the template. Replace the example URL with your repository's web URL.
```bash
git clone --depth 1 https://github.com/me/example.git
```
--------------------------------
### Error: binary with name "go" not found
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Example error output when the Go programming language is not available on your system.
```console
$ hugo server
Error: failed to download modules: binary with name "go" not found
```
--------------------------------
### Run the built Docker image with docker-compose up
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Runs the built Docker container with a volume bound to the docsy-example folder. Can be combined with the build step using `docker-compose up --build`.
```bash
docker-compose up
```
--------------------------------
### Build the Docker image with docker-compose build
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Builds the Docker image for the docsy-example container. Requires Docker Desktop on Windows/Mac or Docker Compose on Linux.
```bash
docker-compose build
```
--------------------------------
### Run Hugo server with workspace
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Run the Hugo server with the HUGO_MODULE_WORKSPACE environment variable to watch the local Docsy clone. Alternatively, use npm with the 'local' prefix.
```shell
HUGO_MODULE_WORKSPACE=docsy.work hugo server --ignoreVendorPaths "**"
```
```shell
npm run local serve
```
--------------------------------
### Angular.bootstrap manual startup example
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/scala/NG_NAMESPACE_PARITY.md
Shows how to manually start an AngularTS application with angular.bootstrap(). The app is created with angular.createModule() and a controller is registered. Do not bootstrap on an element with a transclusion directive like ng-if, ng-include, or ng-view, as this misplaces the root element and injector.
```html
{{greeting}}
```
--------------------------------
### Import AngularTS singleton
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/quickstart.md
Imports the angular singleton from the installed npm package. Use this in a JavaScript module after installing the package.
```js
import { angular } from '@angular-wave/angular.ts';
```
--------------------------------
### params configuration example
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/RouterModuleDeclaration.html
Example of configuring state parameters with type, array, and value options.
```javascript
params: { param1: { type: "int", array: true, value: [] }, param2: { value: "index" }}
```
--------------------------------
### View Hugo module graph with hugo mod graph
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Run from the repository root to inspect the Docsy theme and its dependencies as a Hugo module graph. The output is truncated in the documentation.
```console
$ hugo mod graph
...
```
--------------------------------
### Run the Pulse reference application
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/integrations/android.md
Starts the Pulse reference application on an Android emulator. The command starts its local Node server, installs the sample, and opens it in the emulator. Requires one Android emulator to be running.
```bash
make -C integrations/android sample-social-run
```
--------------------------------
### Complete counter example with directives only
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/quickstart.md
A self-contained counter using only HTML attributes and no separate JavaScript file. Uses ng-app for auto-bootstrap, ng-cloak to prevent flash of unrendered expressions, ng-init to set count to 0, and ng-click to increment.
```html
```
--------------------------------
### Bootstrap AngularTS application with HTML example
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/classes/AngularRuntime.html
Manually starts an AngularTS application. Detects multiple loads and warns in console. Do not bootstrap on elements with transclusion directives like ng-if, ng-include, or ng-view. The example shows a complete HTML page with a controller and bootstrap call.
```html
{{greeting}}
```
--------------------------------
### Error: TOCSS failed to transform scss/main.scss
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Example error output when the extended version of Hugo is not installed.
```console
$ hugo server
INFO 2021/01/21 21:07:55 Using config file:
Building sites … INFO 2021/01/21 21:07:55 syncing static files to /
Built in 288 ms
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache
```
--------------------------------
### Clone Docsy theme into sibling folder
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Clone the Docsy theme version v0.12.0 into a sibling folder of your site's root folder. Requires Go version 1.18 or higher.
```shell
cd root-of-your-site
git clone --branch v0.12.0 https://github.com/google/docsy.git ../docsy
```
--------------------------------
### HTML page with AngularTS CDN script
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/quickstart.md
Base HTML document that loads the AngularTS UMD bundle from jsDelivr. The script tag is the only required setup for the full framework; application markup goes inside the body.
```html
My AngularTS App
```
--------------------------------
### Install, build, and test with npm
Source: https://github.com/angular-wave/angular.ts/blob/master/tools/vscode/README.md
Use Node.js 22 or newer. Runs install, build, unit tests, and the CI-friendly language-service harness (test:lsp) without launching a VS Code window.
```sh
npm install
npm run build
npm test
npm run test:lsp
```
--------------------------------
### Verification Commands for Narrowest Relevant Test
Source: https://github.com/angular-wave/angular.ts/blob/master/src/DOCUMENTATION_REQUIREMENT.md
Run these commands to verify changes, starting with the narrowest relevant test. The commands check generated files, documentation examples, and generate documentation.
```bash
make generated-check
make docs-examples-check
make doc
```
--------------------------------
### Verification Commands for Docs-Only Changes with Examples
Source: https://github.com/angular-wave/angular.ts/blob/master/src/DOCUMENTATION_REQUIREMENT.md
Use these commands for documentation-only changes that include examples. They validate documentation examples and generate documentation.
```bash
make docs-examples-check
make doc
```
--------------------------------
### parent state configuration example
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/RouterModuleDeclaration.html
Example of explicitly setting the parent state using the parent property, with a comment showing alternative using a JavaScript variable.
```javascript
var parentstate = { name: 'parentstate'}var childstate = { name: 'childstate', parent: 'parentstate' // or use a JS var which is the parent StateDeclaration, i.e.: // parent: parentstate}
```
--------------------------------
### Bootstrap HarmonyOS toolchain from local archive
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/README.md
Provides the official Linux command-line tools archive and its SHA-256 digest to the bootstrap target for a reproducible local or CI installation. The bootstrap installs under .tools/ without changing shell configuration.
```bash
HARMONY_COMMAND_LINE_TOOLS_ARCHIVE="$HOME/Downloads/command-line-tools-linux.zip" \
HARMONY_COMMAND_LINE_TOOLS_SHA256="" \
make -C integrations/harmonyos bootstrap
```
--------------------------------
### bindings example: map resolves to component bindings
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/StateDeclaration.html
Shows how to map component input bindings to resolves of different names. The component's 'baz' binding gets data from the 'bar' resolve, while 'foo' uses default behavior. Requires a component with matching bindings.
```javascript
app.router('foo', { resolve: { foo: ['FooService', function(FooService) { return FooService.get(); }], bar: ['BarService', function(BarService) { return BarService.get(); }] }, component: 'Baz', // The component's `baz` binding gets data from the `bar` resolve // The component's `foo` binding gets data from the `foo` resolve (default behavior) bindings: { baz: 'bar' }});app.component('Baz', { templateUrl: 'baz.html', controller: 'BazController', bindings: { foo: '<', // foo binding baz: '<' // baz binding }});
```
--------------------------------
### Remove Docker images with docker-compose rm
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Removes the produced Docker images after stopping the container with Ctrl+C.
```bash
docker-compose rm
```
--------------------------------
### Declare workspace in hugo.toml
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Declare the workspace file in your hugo.toml settings file. The directive is commented out by default; remove the trailing '//' to enable it.
```toml
[module]
workspace = "docsy.work"
```
--------------------------------
### Programmatic navigation example
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/services/routing.md
Example controller using $state.go() and $state.href() for programmatic navigation. Demonstrates relative navigation with '^' and generating a link.
```ts
class OrderController {
static $inject = ['$state'];
order!: Order;
constructor(private $state: ng.StateService) {}
viewOrder(id: number) {
this.$state.go('orders.detail', { orderId: id });
}
backToList() {
this.$state.go('^');
}
get orderLink(): string | null {
return this.$state.href('orders.detail', { orderId: this.order.id });
}
}
```
--------------------------------
### Bootstrap HarmonyOS toolchain from authenticated URL
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/README.md
Uses an authenticated Huawei download URL and its verified SHA-256 digest instead of a checked-in archive for CI bootstrap. The bootstrap installs under .tools/ without changing shell configuration.
```bash
HARMONY_COMMAND_LINE_TOOLS_URL="" \
HARMONY_COMMAND_LINE_TOOLS_SHA256="" \
make -C integrations/harmonyos bootstrap
```
--------------------------------
### Run Pulse server and compile HarmonyOS shell
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/README.md
Starts the platform-neutral Pulse server and compiles the HarmonyOS shell. Pass a reachable pulseUrl Want parameter; the default http://127.0.0.1:4175/ requires device-to-host port forwarding.
```bash
node integrations/native/samples/pulse/server.mjs --port 4175
```
```bash
make -C integrations/harmonyos/samples/pulse compile
```
--------------------------------
### Todo list HTML and AngularTS module with two-way binding
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/quickstart.md
Complete todo list example combining a named module, two-way binding, and list rendering. Includes the HTML template with ng-app, ng-controller, ng-submit, ng-model, and ng-repeat directives, followed by the AngularTS module definition with a controller that manages todos. Requires the normal AngularTS script tag in the document head.
```html
{{ todo.text }}
```
--------------------------------
### Shorthand methods: get and post
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/service/http.md
Use $http.get for simple GET requests and $http.post for sending JSON data. The get example destructures the response to access data directly.
```ts
$http.get('/api/users/42').then(({ data }) => {
user = data;
});
$http.post('/api/users', {
name: 'Ada',
email: 'ada@example.com',
});
```
--------------------------------
### Run bootstrap, proof, and compatibility-check targets
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Use these Make targets to bootstrap the HarmonyOS toolchain, run the platform proof, and perform the compatibility check. Each command must succeed in order before proceeding to the next slice.
```bash
make -C integrations/harmonyos bootstrap
```
```bash
make -C integrations/harmonyos proof
```
```bash
make -C integrations/harmonyos compatibility-check
```
--------------------------------
### Start Pulse server
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/integrations/harmonyos.md
Starts the Pulse sample server on port 4175. Android and HarmonyOS share the same HTML, JavaScript, routes, server, and assets; the HarmonyOS project contains only the Stage-model shell.
```bash
node integrations/native/samples/pulse/server.mjs --port 4175
```
--------------------------------
### Get specific controller with angular.getController($0, 'ngModel')
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/cookbook/inspect-running-application.md
Pass a directive name to get a specific controller. For example, select an input with ng-model and run this to get the ngModel controller.
```javascript
const model = angular.getController($0, 'ngModel');
model;
```
--------------------------------
### Install AngularTS via npm
Source: https://github.com/angular-wave/angular.ts/blob/master/README.md
Install the AngularTS package from npm. The published package includes generated TypeScript declarations under @types/.
```bash
npm install @angular-wave/angular.ts
```
--------------------------------
### GET /api/users/99
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/service/http.md
Example of making a GET request using the Angular HTTP service and handling errors based on transportStatus and HTTP status.
```APIDOC
## [GET] /api/users/99
### Description
Example of a GET request to fetch a user by ID, demonstrating error handling for timeouts and HTTP 404 responses.
### Method
GET
### Endpoint
/api/users/99
### Response
#### Success Response (2xx)
Resolves with an `HttpResponse` object.
#### Error Response (non-2xx)
Rejects with an `HttpError` object that includes `transportStatus`, `status`, `statusText`, `headers`, `config`, and `response`.
### Example
```ts
$http.get('/api/users/99').catch((error) => {
if (error.transportStatus === 'timeout') {
message = 'Request timed out.';
} else if (error.status === 404) {
message = 'User not found.';
} else {
throw error;
}
});
```
```
--------------------------------
### Example usage of ng-cloak
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/directive/cloak.md
Example showing inline style and a section with ng-cloak to hide content until Angular compiles.
```html
These tags are invisible {{ hello }}
```
--------------------------------
### AngularTS HTML-first template with ng-app and ng-init
Source: https://github.com/angular-wave/angular.ts/blob/master/README.md
AngularTS starts with HTML. This example uses ng-app and ng-init to set a variable and display it with interpolation.
```html
Hello {{ x }}
```
--------------------------------
### Run all repository and integration checks
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Run the full set of repository, integration, HarmonyOS, device, and release preflight checks from a clean checkout. Replace with the release version.
```bash
make check
make test-integrations
make harmonyos-check
make -C integrations/harmonyos device-check
make release-preflight VERSION=
```
--------------------------------
### Prepare release targets (patch, minor, major)
Source: https://github.com/angular-wave/angular.ts/blob/master/RELEASE.md
Run exactly one of these make targets to prepare a release. The selected target confirms the current version matches the latest stable tag, promotes Unreleased to a dated changelog entry, leaves a new empty Unreleased section, synchronizes all distribution and integration files, regenerates versioned website files, and runs the complete local release gate. The update is transactional; missing notes or stale integration metadata stop the command before writing files.
```bash
make prepare-patch-release
```
```bash
make prepare-minor-release
```
```bash
make prepare-major-release
```
--------------------------------
### resolve property as an array
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/RouterModuleDeclaration.html
Defines a state's resolve property as an array of ResolvableLiteral objects. The example shows a 'user' resolve that injects the Transition and UserService, with an eager flag to start fetching at transition start.
```javascript
var state = { name: 'user', url: '/user/:userId resolve: [ { token: 'user', eager: true, deps: ['UserService', Transition], resolveFn: (userSvc, trans) => userSvc.fetchUser(trans.params().userId) }, } ]}
```
--------------------------------
### Install wasm-tools workload
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/integrations/wasm-csharp.md
Install the .NET WebAssembly build tools workload required to publish for browser-wasm.
```bash
dotnet workload install wasm-tools
```
--------------------------------
### Error: Module not compatible with Hugo version
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/README.md
Example error output when running an outdated Hugo version. Requires Hugo version 0.146.0 or higher as of Docsy v0.12.0.
```console
$ hugo server
WARN 2023/06/27 16:59:06 Module "project" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Start building sites …
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
Error: Error building site: "C:\Users\foo\path\to\docsy-example\content\en\_index.md:5:1": failed to extract shortcode: template for shortcode "blocks/cover" not found
Built in 27 ms
```
--------------------------------
### Start Karma autotest server
Source: https://github.com/angular-wave/angular.ts/blob/master/DEVELOPERS.md
Starts the Karma server, captures Chrome, and runs unit tests continuously on file changes.
```shell
yarn grunt autotest
```
--------------------------------
### ng-get basic usage
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/directive/get.md
Minimal example of the ng-get directive with a URL to issue a GET request to.
```html
get
```
--------------------------------
### Run node, layout, accessibility, and render benchmark tests
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Commands to run the gate tests for the native node registry, layout, and style system slice. Execute from the repository root.
```bash
make -C integrations/harmonyos node-test
make -C integrations/harmonyos layout-test
make -C integrations/harmonyos accessibility-test
make -C integrations/harmonyos render-benchmark
```
--------------------------------
### Compile kitchen sink sample
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/integrations/harmonyos.md
Builds the kitchen sink sample to inspect every native element and its current contract. The page is generated from shared catalogs, so checks fail when a property, event, method, or capability is missing.
```bash
make -C integrations/harmonyos/samples/kitchen-sink compile
```
--------------------------------
### Transition.entering
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/scala/NG_NAMESPACE_PARITY.md
Gets the states being entered by this transition.
```APIDOC
## Transition.entering
### Description
Gets the states being entered by this transition.
### Method
Transition.entering
### Parameters
None
```
--------------------------------
### Configure custom interpolation delimiters with $interpolate
Source: https://github.com/angular-wave/angular.ts/blob/master/src/core/interpolate/README.md
Sets application-wide start and end delimiters for interpolation before service construction. The delimiters are applied to all interpolation text compiled by the service. This example uses '[[ ]' instead of the default '{{ }}'.
```TypeScript
const app = angular.createModule("app", []);
app.config({
$interpolate: {
startSymbol: "[[",
endSymbol: "]]",
},
});
```
```HTML
Hello [[ user.name ]]
```
--------------------------------
### ParamDeclaration usage example in state params
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/ParamDeclaration.html
Shows how to define a ParamDeclaration for each state parameter, including type, default value, and squash options. The example includes a shorthand for the default value using a literal.
```javascript
var mystate = { template: '', controller: function() {} url: '/mystate/:start?{count:int}', params: { start: { // <-- ParamDeclaration for `start` type: 'date', value: new Date(), // <-- Default value squash: true, }, nonUrlParam: { // <-- ParamDeclaration for 'nonUrlParam' type: "int", array: true, value: [] }, count: 0, // <-- Default value for 'param1' // (shorthand ParamDeclaration.value) }}
```
--------------------------------
### $transitions.onStart
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/routing/transitions.md
Registers an async hook that fires as the transition starts running, after onBefore is settled but before any states are exited. Eager resolves are fetched here. Returns a deregistration function.
```APIDOC
## [HOOK] $transitions.onStart
### Description
Registers an async hook that fires as the transition starts running—after `onBefore` is settled but before any states are exited. Eager resolves are fetched here.
### Method
onStart
### Endpoint
$transitions.onStart
### Parameters
#### matchCriteria (HookMatchCriteria) - Required
- Object with optional keys `to`, `from`, `exiting`, `retained`, and `entering`.
- Each value can be:
- A state name string or glob (e.g., `'contacts.**'`)
- A function `(state, transition) => boolean`
- `true` to match any state (default when key omitted)
#### callback (function) - Required
- `(transition: Transition) => HookResult`
#### options (HookRegOptions) - Optional
- `priority` (number) - higher priority runs first (default: 0)
- `bind` (object) - `this` inside callback
- `invokeLimit` (number) - auto-deregister after N invocations
### Returns
- Deregistration function `() => void`
### Example
```js
$transitions.onStart({}, callback);
// Matches using a function predicate
$transitions.onStart(
{
to: function (state) {
return state.policy?.navigation?.authenticated === true;
},
},
callback,
);
```
```
--------------------------------
### component example: use a component for a state
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/StateDeclaration.html
Defines a state that uses the component. When using 'component', you cannot use 'template', 'templateUrl', or 'controller'.
```javascript
.state('profile', { // Use the component for this state. component: 'MyProfile',}
```
--------------------------------
### bootstrap(element, modules?)
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/classes/AngularRuntime.html
Manually starts up an AngularTS application. Detects multiple loads and only allows the first script to bootstrap. Returns the created injector instance.
```APIDOC
## bootstrap(element, modules?)
### Description
Use this function to manually start up AngularTS application. AngularTS will detect if it has been loaded into the browser more than once and only allow the first loaded script to be bootstrapped and will report a warning to the browser console for each of the subsequent scripts. This prevents strange results in applications, where otherwise multiple instances of AngularTS try to work on the DOM.
### Method
bootstrap
### Parameters
- **element** (string | HTMLElement | HTMLDocument) - Required - DOM element which is the root of AngularTS application.
- **modules** (ModuleLike[]) - Optional - An array of modules to load into the application. Each item in the array should be the name of a predefined module or a (DI annotated) function that will be invoked by the injector as a `config` block.
### Returns
InjectorService - The created injector instance for this application.
### Example
```html
{{greeting}}
```
```
--------------------------------
### resolve property as an array
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/StateDeclaration.html
Defines a state's resolve as an array of ResolvableLiteral objects. The example shows a 'user' resolve that injects the Transition and UserService, with the eager flag controlling when the resolve starts. The fetched data can be used in views or nested states.
```javascript
var state = {
name: 'user',
url: '/user/:userId
resolve: [
{
token: 'user',
eager: true,
deps: ['UserService', Transition],
resolveFn: (userSvc, trans) => userSvc.fetchUser(trans.params().userId) },
}
]
}
```
--------------------------------
### Generate links with $state.href()
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/services/routing.md
Use $state.href() to generate URLs without starting navigation. Pass { absolute: true } to get an absolute URL.
```ts
const relative = $state.href('contacts.detail', { id: 42 });
const absolute = $state.href('contacts.detail', { id: 42 }, { absolute: true });
```
--------------------------------
### Example: array parameter with array: true
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/ParamDeclaration.html
Shows how to configure a query parameter with array mode set to true. After the transition, the URL becomes '/foo?arrayParam=1&arrayParam=2&arrayParam=3'.
```javascript
{ name: 'foo', url: '/foo?arrayParam', params: { arrayParam: { array: true } }}// After the transition, URL should be '/foo?arrayParam=1&arrayParam=2&arrayParam=3'$state.go("foo", { arrayParam: [ 1, 2, 3 ] });
```
--------------------------------
### Create an AngularTS module
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/quickstart.md
Creates a module named 'myApp' with no dependencies. The first argument is the module name; the second is an array of dependency modules. Reference this name in the ng-app attribute to bootstrap the module.
```js
const app = angular.createModule('myApp', []);
```
--------------------------------
### Run overlay and navigation component tests
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Commands to run tests for overlays, navigation components, and adaptive layouts in the HarmonyOS integration.
```bash
make -C integrations/harmonyos overlay-test
make -C integrations/harmonyos navigation-component-test
make -C integrations/harmonyos adaptive-layout-test
```
--------------------------------
### TransitionsService.onStart example: Load feature shell data during transition
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/scala/NG_NAMESPACE_PARITY.md
Registers an onStart hook that pauses transitions into the 'reports.**' branch while an application-level feature shell loads. The hook retrieves the 'ReportsShell' service from the transition injector and returns its ensureLoaded() promise, which can pause, cancel, or redirect the transition. Use state resolve for route data and policy.navigation for security; transition hooks are for advanced orchestration spanning multiple states.
```javascript
$transitions.onStart({ to: 'reports.**' }, function(trans) {
var reportsShell = trans.injector().get('ReportsShell');
return reportsShell.ensureLoaded();
});
```
--------------------------------
### Run content, layout, and visual tests (make -C integrations/harmonyos content-test, layout-component-test, visual-test)
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Gate commands for Slice 6. Run from the repository root to execute content element tests, layout component tests, and visual tests for the HarmonyOS integration.
```bash
make -C integrations/harmonyos content-test
make -C integrations/harmonyos layout-component-test
make -C integrations/harmonyos visual-test
```
--------------------------------
### Run optional package tests (browser, credentials, maps, media)
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Executes the test suites for the optional capability packages (browser, credentials, maps, media) and verifies parity with Android contracts. Run these from the repository root.
```bash
make -C integrations/harmonyos browser-test
make -C integrations/harmonyos credentials-test
make -C integrations/harmonyos maps-test
make -C integrations/harmonyos media-test
make -C integrations/harmonyos optional-package-parity
```
--------------------------------
### Access workflow diagnostics and history
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/service/workflow.md
Use `workflow.diagnostics` to get normalized, serializable evidence from failed operations and `workflow.history` to record command start, completion, and final failure.
```js
workflow.diagnostics;
workflow.history;
```
--------------------------------
### JavaScript: Try ng-el in DevTools with angular.getScope
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/cookbook/select-elements.md
Select the section element in DevTools and run this to get its scope and modify the element. No selector, element ID, or setup callback is needed.
```javascript
const scope = angular.getScope($0);
scope.statusEl.textContent = 'Saved';
scope.statusEl.className = 'status status-success';
```
--------------------------------
### Prepare release when version already prepared
Source: https://github.com/angular-wave/angular.ts/blob/master/RELEASE.md
Run this target instead of selecting another bump when the version is already prepared. It continues the release preparation without recalculating the version.
```bash
make prepare-release
```
--------------------------------
### Bootstrap HarmonyOS SDK with verified archive
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/integrations/harmonyos.md
Installs a local official HarmonyOS command-line tools archive using the bootstrap target. Requires a SHA-256 digest for security; do not run unverified archives.
```bash
HARMONY_COMMAND_LINE_TOOLS_ARCHIVE="$HOME/Downloads/command-line-tools-linux.zip" \
HARMONY_COMMAND_LINE_TOOLS_SHA256="" \
make -C integrations/harmonyos bootstrap
```
--------------------------------
### Transition.to
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/scala/NG_NAMESPACE_PARITY.md
Returns the state that the transition is going to.
```APIDOC
## Transition.to
### Description
Returns the state that the transition is going to.
### Method
Transition.to
### Parameters
None
```
--------------------------------
### Gates for Slice 2: Package And Server Foundation
Source: https://github.com/angular-wave/angular.ts/blob/master/tools/mcp/ROADMAP.md
Run these commands to verify the MCP package builds, tests pass, and the CLI responds to --help and --version. The CLI is built to tools/mcp/dist/cli.js.
```shell
make mcp-build
make mcp-test
node tools/mcp/dist/cli.js --help
node tools/mcp/dist/cli.js --version
```
--------------------------------
### deletePrefix(prefix: string): Promise
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/RestCacheStore.html
Delete cached REST responses whose keys start with the given prefix. CachedRestBackend uses prefixes such as 'GET /api/users' to invalidate collection and entity entries after successful writes.
```APIDOC
## deletePrefix(prefix: string): Promise
### Description
Delete cached REST responses whose keys start with the prefix.
### Method
deletePrefix
### Parameters
- **prefix** (string) - Required - The prefix to match cache keys against.
### Returns
Promise
```
--------------------------------
### ng-bind example with interpolation comparison
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/directives/data-binding.md
Shows the attribute equivalent of double-curly interpolation. ng-bind sets textContent, making it XSS-safe. The element starts empty until AngularTS compiles, avoiding FOUC in server-rendered pages.
```html
Hello, {{ user.name }}!
Hello, !
```
--------------------------------
### Kitchen Sink and Pulse Verification Gates
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Run these make targets to verify the kitchen sink, sample social, and visual regression checks for the HarmonyOS integration.
```bash
make -C integrations/harmonyos kitchen-sink-check
make -C integrations/harmonyos sample-social-check
make -C integrations/harmonyos visual-regression
```
--------------------------------
### Controller-owned machine for local UI flow
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/service/machine.md
Assign the machine to a controller to keep the flow alive for local UI data. The machine starts in 'setup' state and updates roomId on 'join' event.
```javascript
app.controller('SessionCtrl', [
'$machine',
function ($machine) {
this.session = $machine({
initial: 'setup',
data: { roomId: '' },
states: {
setup: {
on: {
join: {
to: 'waiting',
update({ data, payload }) {
data.roomId = payload.roomId;
},
},
},
},
waiting: {},
},
});
},
]);
```
--------------------------------
### HTML form to start and poll a background job
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/cookbook/background-job.md
Use this HTML form to start a background job via POST and poll its status with a GET request. The form includes a format selector and a submit button; after submission, the job status and a download link appear when available. Manual refresh is recommended initially; add polling or server-sent events only if continuous progress is needed.
```html
```
--------------------------------
### SseConfig.onOpen
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/scala/NG_NAMESPACE_PARITY.md
Called when the connection opens.
```APIDOC
## SseConfig.onOpen
### Description
Called when the connection opens.
### Method
Callback
### Parameters
- **event** (Event) - Required - Value supplied for the event parameter.
### Response
No return value documented.
```
--------------------------------
### Define CounterController with $scope
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/quickstart.md
Defines a controller that manages a counter on $scope. The controller receives a $scope object as the data model; count starts at 0, increment increases it, and decrement decreases it only when count is greater than 0.
```js
const app = angular.createModule('myApp', []);
app.controller('CounterController', [
'$scope',
function ($scope) {
$scope.count = 0;
$scope.increment = function () {
$scope.count++;
};
$scope.decrement = function () {
if ($scope.count > 0) {
$scope.count--;
}
};
},
]);
```
--------------------------------
### Rust: WasmScope usage example
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/wasm/ABI.md
Shows how to use the Rust facade's WasmScope to set, sync, watch, and unwatch scope values.
```rust
use angular_ts::{read_abi_json, read_abi_string, WasmScope};
let scope = WasmScope::new(scope_handle, "ctrl".to_string());
scope.set("items", items.into());
scope.sync();
let watch_handle = scope.watch("items");
scope.unwatch(watch_handle);
```
--------------------------------
### Run capability, permission, and capability parity tests (Slice 10 gates)
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Gate commands for Slice 10. Run from the repository root. Each command targets a specific test suite: capability-test, permission-test, and capability-parity.
```bash
make -C integrations/harmonyos capability-test
```
```bash
make -C integrations/harmonyos permission-test
```
```bash
make -C integrations/harmonyos capability-parity
```
--------------------------------
### Run input and form parity tests (make -C integrations/harmonyos input-test, form-parity)
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Gate commands for Slice 5. Run from the repository root to execute input contract tests and form parity tests for the HarmonyOS integration.
```bash
make -C integrations/harmonyos input-test
make -C integrations/harmonyos form-parity
```
--------------------------------
### redirectTo property examples
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/StateDeclaration.html
Shows the various forms of the redirectTo property: a string, a {state, params} object, a function returning a string or object, a function returning a promise, and a function that fetches resolve data. redirectTo is processed as an onStart hook before non-eager resolves; use transition.injector().getAsync() to access resolve data.
```javascript
// a string.
state('A', { redirectTo: 'A.B'})
// a {state, params} object.
state('C', { redirectTo: { state: 'C.D', params: { foo: 'index' } }})
// a fn.
state('E', { redirectTo: () => "A"})
// a fn conditionally returning a {state, params}.
state('F', { redirectTo: (trans) => {
if (trans.params().foo < 10)
return { state: 'F', params: { foo: 10 } };
}})
// a fn returning a promise for a redirect.
state('G', { redirectTo: (trans) => {
let svc = trans.injector().get('SomeAsyncService')
let promise = svc.getAsyncRedirectTo(trans.params.foo);
return promise;
}})
// a fn that fetches resolve data.
state('G', { redirectTo: (trans) => {
// getAsync tells the resolve to load
let resolvePromise = trans.injector().getAsync('SomeResolve')
return resolvePromise.then(resolveData => resolveData === 'login' ? 'login' : null);
}})
```
--------------------------------
### Inject $rest to create a resource client at runtime
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/services/rest.md
Use $rest as an injectable factory to create a typed resource client. The example defines a UserRepository that injects $rest and creates a resource for '/api/users' with the User entity class, then uses list() and get() methods.
```TypeScript
class UserRepository {
static $inject = ['$rest'];
private users: ng.RestService;
constructor($rest: ng.RestFactory) {
this.users = $rest('/api/users', User);
}
listAdmins() {
return this.users.list({ role: 'admin' });
}
getUser(id: number) {
return this.users.get(id);
}
}
```
--------------------------------
### bindings property example: mapping resolves to component bindings
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/RouterModuleDeclaration.html
Shows how to map resolve data to component input bindings using the `bindings` property. The component's `baz` binding gets data from the `bar` resolve, while `foo` uses default behavior. Includes the component definition with its bindings.
```javascript
app.router('foo', { resolve: { foo: ['FooService', function(FooService) { return FooService.get(); }], bar: ['BarService', function(BarService) { return BarService.get(); }] }, component: 'Baz', // The component's `baz` binding gets data from the `bar` resolve // The component's `foo` binding gets data from the `foo` resolve (default behavior) bindings: { baz: 'bar' }});
```
```javascript
app.component('Baz', { templateUrl: 'baz.html', controller: 'BazController', bindings: { foo: '<', // foo binding baz: '<' // baz binding }});
```
--------------------------------
### Implement custom RestBackend with IndexedDbRestBackend
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/services/rest.md
A custom backend implements ng.RestBackend and returns raw response data for RestService to map. The example handles GET requests by reading from IndexedDB and throws for unsupported methods. Use HttpRestBackend to delegate to $http and wrap with CachedRestBackend for cache strategies.
```ts
class IndexedDbRestBackend implements ng.RestBackend {
async request(request: ng.RestRequest): Promise> {
if (request.method === 'GET') {
return { data: (await readFromDb(request.url)) as T };
}
throw new Error(`Unsupported method: ${request.method}`);
}
}
const articles = $rest('/api/articles', Article, {
backend: new IndexedDbRestBackend(),
});
```
--------------------------------
### template example: function returning template
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/ViewDeclaration.html
Shows how to set the `template` property with a function that returns an HTML template string. The function receives the Transition parameters as its first argument.
```javascript
template: function(params) { return "
generated template
";}
```
--------------------------------
### Run paging and collection tests
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Commands to run tests for paging, collection parity, and collection benchmarks in the HarmonyOS integration.
```bash
make -C integrations/harmonyos paging-test
make -C integrations/harmonyos collection-parity
make -C integrations/harmonyos collection-benchmark
```
--------------------------------
### Manual bootstrap with angular.bootstrap()
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/installation.md
Use this HTML example to manually bootstrap an Angular.ts application by calling angular.bootstrap() instead of using ng-app. It includes a script tag for the UMD build, a controller defined via angular.createModule, and the bootstrap call. Do not call angular.bootstrap() on an element with ng-app or transclusion directives like ng-view or ng-if.
```html
{{ greeting }}
```
--------------------------------
### Run navigation, transition, and router parity tests (Slice 9 gates)
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Gate commands for Slice 9. Run from the repository root. Each command targets a specific test suite: navigation-test, transition-test, and router-parity.
```bash
make -C integrations/harmonyos navigation-test
```
```bash
make -C integrations/harmonyos transition-test
```
```bash
make -C integrations/harmonyos router-parity
```
--------------------------------
### Record task save with performance marks
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/guides/observability.md
Assigns a stable operation name and correlation ID at the user-action boundary, records the terminal outcome, and rethrows unexpected exceptions. Use this pattern for critical user actions to capture start, outcome, and duration without logging every reactive read or scope write.
```JavaScript
performance.mark(`task-save:${id}:start`);
try {
await repository.save(task);
record({ operation: 'task.save', outcome: 'success', id });
} catch (error) {
record({ operation: 'task.save', outcome: classify(error), id });
throw error;
}
```
--------------------------------
### Install AngularTS with pnpm
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/installation.md
Install the package from the npm registry using pnpm.
```bash
pnpm add @angular-wave/angular.ts
```
--------------------------------
### Commit and push prepared release
Source: https://github.com/angular-wave/angular.ts/blob/master/RELEASE.md
Commit and push the complete preparation after reviewing the version, changelog, generated bundles, package metadata, and integration coordinates. The local release gate runs the pre-commit suite, npm package verification, and all maintained integration package and runtime tests. The pre-commit hook must pass; the release command rejects a dirty worktree or a local commit that does not match origin/master.
```bash
git add .
```
```bash
git commit -m "Release "
```
```bash
git push origin master
```
--------------------------------
### Install AngularTS with yarn
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/get-started/installation.md
Install the package from the npm registry using yarn.
```bash
yarn add @angular-wave/angular.ts
```
--------------------------------
### Demo page URL
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/closure/clojurescript/bin/target/classes/META-INF/README.md
The demo page is available at this URL.
```text
http://localhost:4000/integrations/closure/clojurescript/demo/index.html
```
--------------------------------
### Export HARMONY_COMMAND_LINE_TOOLS_HOME and run toolchain-check
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/content/docs/integrations/harmonyos.md
Sets the environment variable to point to an existing HarmonyOS command-line tools installation, then runs the toolchain check target to verify the required tools (ohpm, hvigorw, codelinter) are available.
```bash
export HARMONY_COMMAND_LINE_TOOLS_HOME="$HOME/command-line-tools"
make -C integrations/harmonyos toolchain-check
```
--------------------------------
### Documentation and Integration Synchronization Gates
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/ROADMAP.md
Run these Makefile targets to validate documentation and snippet tests for the HarmonyOS integration. The gates ensure generated contract tables stay in sync with shipped packages.
```bash
make docs-check
make docs-snippet-test
make integration-docs-check
```
--------------------------------
### get
Source: https://github.com/angular-wave/angular.ts/blob/master/docs/static/typedoc/interfaces/WasmScope.html
Gets the value at the given path.
```APIDOC
## get
### Description
Gets the value at the given path.
### Method
get
### Parameters
- **path** (string) - Required - The path to get.
### Returns
unknown
```
--------------------------------
### Install @angular-wave/angular-native-harmony-core via ohpm
Source: https://github.com/angular-wave/angular.ts/blob/master/integrations/harmonyos/packages/core/README.md
Install the AngularTS Native HarmonyOS Core package version 0.37.0 using the ohpm package manager.
```sh
ohpm install @angular-wave/angular-native-harmony-core@0.37.0
```