{"id":612,"date":"2023-03-06T05:00:00","date_gmt":"2023-03-06T13:00:00","guid":{"rendered":"https:\/\/www.angulartraining.com\/daily-newsletter\/?p=612"},"modified":"2023-03-03T16:47:37","modified_gmt":"2023-03-04T00:47:37","slug":"whats-new-in-angular-15-2","status":"publish","type":"post","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/whats-new-in-angular-15-2\/","title":{"rendered":"What&#8217;s new in Angular 15.2?"},"content":{"rendered":"\n<p>Angular 15.2 was released a few days ago. The main addition to this release is a new Angular CLI schematic to migrate your existing code to standalone components:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">ng generate @angular\/core:standalone<\/code><\/span><\/pre>\n\n\n<p>This schematic isn&#8217;t documented on the Angular website yet, as it&#8217;s still in its early stages. It looks like it has three options so far:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>convert-to-standalone<\/code>: Default option. Converts all components to standalone ones except those declared in your main <code>AppModule<\/code>.<\/li>\n\n\n\n<li><code>prune-ng-modules<\/code>: Deletes all modules that aren&#8217;t necessary anymore because their features have been migrated to standalone components.<\/li>\n\n\n\n<li><code>standalone-bootstrap<\/code>: Bootstraps your application with the <code>bootstrapApplication<\/code> function and migrates the components referenced in your <code>AppModule<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>I&#8217;ll post more information in the newsletter as this new schematic evolves.<\/p>\n\n\n\n<p>Another update is that class-based guards are being deprecated, which means the Angular team is pushing for its new <a href=\"https:\/\/blog.angulartraining.com\/router-utility-functions-in-angular-14-8d843b50d2e2\" target=\"_blank\" rel=\"noopener\" title=\"\">function-based router features<\/a>.<\/p>\n\n\n\n<p>Lastly, a new <code><a href=\"https:\/\/angular.io\/api\/router\/testing\/RouterTestingHarness\" target=\"_blank\" rel=\"noopener\" title=\"\">RouterTestingHarness<\/a><\/code> utility has been added to help with unit-testing components loaded by the router. The Angular team released a <a href=\"https:\/\/blog.angular.io\/write-better-tests-without-router-mocks-stubs-bf5fc95c1c57\" target=\"_blank\" rel=\"noopener\" title=\"\">short guide to explain how to use it<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Angular 15.2 was released a few days ago. The main addition to this release is a new Angular CLI schematic to migrate your existing code to standalone components: This schematic isn&#8217;t documented on the Angular website yet, as it&#8217;s still in its early stages. It looks like it has three options so far: I&#8217;ll post [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-612","post","type-post","status-publish","format-standard","hentry","category-angular"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/comments?post=612"}],"version-history":[{"count":2,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/612\/revisions"}],"predecessor-version":[{"id":614,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/612\/revisions\/614"}],"wp:attachment":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/media?parent=612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/categories?post=612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/tags?post=612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}