
This commit updates the docs examples to Angular v10.1.3. In addition to updating the dependencies versions, it also updates the project's structure and config to more closely match what a new v10 CLI app would look like. See, also, the [diff][1] between a basic v9.1.4 CLI app and a v10.1.3 one. [1]: https://github.com/cexbrayat/angular-cli-diff/compare/9.1.4..10.1.3 PR Close #38993
28 lines
554 B
TypeScript
28 lines
554 B
TypeScript
import * as angular from 'angular';
|
|
import 'angular-route';
|
|
|
|
const appModule = angular.module('myApp', [
|
|
'ngRoute'
|
|
])
|
|
.config(['$routeProvider', '$locationProvider',
|
|
function config($routeProvider, $locationProvider) {
|
|
$locationProvider.html5Mode(true);
|
|
|
|
$routeProvider.
|
|
when('/users', {
|
|
template: `
|
|
<p>
|
|
Users Page
|
|
</p>
|
|
`
|
|
}).
|
|
otherwise({
|
|
template: ''
|
|
});
|
|
}]
|
|
);
|
|
|
|
export function bootstrap(el: HTMLElement) {
|
|
return angular.bootstrap(el, [appModule.name]);
|
|
}
|