These changes include
- Remove the usage of `enableProdMode`
- Remove `test.ts`, `polyfills.ts`, `karma.conf.js` and environment files which are no longer generated by default
PR Close#47904
This commit updates the `RouterLink` to extend the selector to also include `<a>` and `<area>` elements, which were previously matched by the `RouterLinkWithHref` directive. The code of the directives was merged together (since there was a lot of duplication) and this commit finalizes the merge. The `RouterLinkWithHref` becomes an alias of the `RouterLink` directive.
Now there is no need to import and use the `RouterLinkWithHref` class, the `RouterLink` directive will match any element that has the `routerLink` attribute.
DEPRECATED:
The `RouterLinkWithHref` directive is deprecated, use the `RouterLink` directive instead. The `RouterLink` contains the code from the `RouterLinkWithHref` to handle elements with `href` attributes.
PR Close#47630
Update the docs examples to the latest prerelease versions of Angular
CLI and framework (v14.0.0-rc.0).
Also update the example apps to more closely align with new CLI apps.
See also the [diff][1] between a basic v13.0.0-rc.3 CLI app and a
v14.0.0-rc.0 one.
[1]: https://github.com/cexbrayat/angular-cli-diff/compare/13.0.0-rc.3...14.0.0-rc.0
PR Close#45997
Fixes issue #45769
Removes the malevolent comic book character, "Narco," from the list of heroes. This change removes the reference from the code, text and screenshots used in the documentation and makes other minor edits as necessary.
PR Close#46008
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
PR Close#45397
add types to all the buttons in the angular.io examples to encourage
the best practice of always including a type per button (regardless
to whether it is in a form or now)
PR Close#44557
remove the comments present in aio examples saying that for older
browsers such as IE CustomEvent could be necessary (as the the Event
constructor could be not available)
such comments are no longer necessary/relevant since the Event constructor
is available for all the supported browsers
PR Close#44557
the aio examples have various eslint issues regarding template rules, those
are currently turned off and TODO comments have been added to them in the
examples eslintrc, fix such issues and remove the respective TODO comments
this also includes examples refactoring to use buttons for better accessibility,
this change tries to make the smallest amound of changes to the examples' behaviors
and designs/UI
PR Close#44557
The jasmine used in the docs is
```typescript
expect(<variableName>).<matcher>(predicate, failOutput)
```
The new version should be
```typescript
expect(<variableName>).withContext(failOutput).<matcher>(predicate)
```
So, this commit mainly focuses on changing the former to latter with
format below
```typescript
expect(<variableName>)
.withContext(failOutput)
.<matcher>(predicate)
```
And for RxJs, see https://rxjs.dev/deprecations/subscribe-arguments.
> For example someone could name functions poorly and confuse the next
reader: `source$.subscribe(doSomething, doSomethingElse, lol)` with that
signature, you have to know unapparent details about subscribe, where
using a partial observer solves that neatly: `source$.subscribe({ next:
doSomething, error: doSomethingElse, complete: lol }`).
This commit also does this conversion.
Last, remove the unused imported `async` from file
`twain.component.marbles.spec.ts`.
PR Close#44674
Currently the `HttpClient` always wraps errors from XHR requests, but
the underlying errors are always of type `ProgressEvent`, or don't have
a native error if the status code is just indicating failure (e.g. 404).
This behavior does not match in the `TestRequest` class provided by
`@angular/common/http/testing` where errors are considered being
of type `ErrorEvent`. This is incorrect because `ErrorEvent`s provide
information for errors in scripts or files which are evaluated. Since
the `HttpClient` never evaluates scripts/files, and also since XHR requests
clearly are documented to emit `ProgressEvent`'s, we should change the
`TestSupport` to retrieve such `ProgressEvent`'s instead of incompatible
objects of type `ErrorEvent`.
In favor of having a deprecation period, we keep supporting `ErrorEvent`
in the `TestRequest.error` signature. Eventually, we can remove this
signature in the future.
Resources:
* https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/error_event
* https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent
* https://xhr.spec.whatwg.org/#event-xhr-errpr
Related to: https://github.com/angular/angular/issues/34748.
DEPRECATED: `TestRequest` from `@angular/common/http/testing` no longer
accepts `ErrorEvent` when simulating XHR errors. Instead instances of
`ProgressEvent` should be passed, matching with the native browser behavior.
PR Close#36082
Example for test doesn't use typing for Jasmine Spy objects. Updated
them with `SpyObj<T>` typing as in the Angular Documentation.
See https://angular.io/guide/testing-services
PR Close#44170
Previously there was a custom version of the testing app for Stackblitz that would run the tests in the browser.
With the web-container approach, this is no longer necessary since the tests can be run directly from the command line.
Fixes#44047
PR Close#44085
This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.
PR Close#43880
Many of the tests in the router code use the deprecated loadChildren as a string. This
has been deprecated for years and can easily be changed to just a function that
returns the module.
PR Close#43578
This commit updates the docs examples to Angular v12.1.3. In addition to
updating the dependencies versions, it also updates the projects'
structure and configs to more closely match what a new v12 CLI app would
look like. See, also, the [diff][1] between a basic v11.2.11 CLI app and
a v12.1.3 one.
[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.11..12.1.3
PR Close#42949
The `NO_ERRORS_SCHEMA` schema can be used to ignore errors related to unknown elements or properties, but since it suppresses these errors it may also hide real problems in a template. This commit updates the `NO_ERRORS_SCHEMA` docs to mention that.
Closes#39454.
PR Close#42327
We should primarily point readers to the stackblitz that contains the spec files and runs them.
The application stackblitz is secondary (and doesn't actually contain the spec files, which is confusing).
Fixes#38535
PR Close#42406
remove `async` and `await` from `BannerComponent` test because the
component uses an inline template and styles
create doc region in `banner-external.component.spec.ts` demonstrating
test setup that may fail due to a missing call to `.compileComponents()`
for a component with an external template and stylesheet
PR Close#42336
remove `@Input()` decorator from `hero` property because the component
is designed to get the hero via a service, not an input binding.
add `HTMLElement` type to `HeroDetailComponent` unit test
PR Close#42349
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
"You should always include at least one generic family name in a font-family list,
since there's no guarantee that any given font is available. This lets the browser
select an acceptable fallback font when necessary."
PR Close#40254
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard box-sizing CSS property
PR Close#40039
This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).
PR Close#39818
Because PhantomJS has been deprecated since March 2018, and `newEvent`
is very confusing for newcomers that read the testing documentation,
we remove it entirely, and instead assume most, if not all, newcomers
will run tests in Chrome as it is the default.
Fixes#23370
PR Close#37251