{"id":7210,"date":"2022-10-15T18:36:23","date_gmt":"2022-10-15T19:06:23","guid":{"rendered":"https:\/\/ultering.com\/it4us\/?p=7210"},"modified":"2022-10-15T19:02:52","modified_gmt":"2022-10-15T19:32:52","slug":"angular-from-scratch-tutorial-step-9-modal","status":"publish","type":"post","link":"https:\/\/ultering.com\/it4us\/?p=7210","title":{"rendered":"Angular From Scratch Tutorial \u2013 Step 9: Modal"},"content":{"rendered":"<p><a href=\"https:\/\/ultering.com\/it4us\/?p=7175\">Angular From Scratch Tutorial &#8211; Index<\/a><br>\n<a href=\"https:\/\/ultering.com\/it4us\/?p=7177\">Angular From Scratch Tutorial \u2013 Step 8: Miscellany<\/a><\/p>\n<h2><\/h2>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69decb72bafc5\" class=\"ez-toc-cssicon-toggle-label\"><span class><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\" \/><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\" \/><\/svg><\/span><\/span><\/label><input type=\"checkbox\" id=\"ez-toc-cssicon-toggle-item-69decb72bafc5\" checked aria-label=\"Toggle\"><nav><ul class=\"ez-toc-list ez-toc-list-level-1 \"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#TARGET\" title=\"TARGET\">TARGET<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#NGX-BOOTSTRAP_MODAL\" title=\"NGX-BOOTSTRAP MODAL\">NGX-BOOTSTRAP MODAL<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#Closing_the_Modal_Returns_Failure\" title=\"Closing the Modal Returns Failure\">Closing the Modal Returns Failure<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#SOLUTION\" title=\"SOLUTION\">SOLUTION<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#BEFORE\" title=\"BEFORE\">BEFORE<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#AFTER\" title=\"AFTER\">AFTER<\/a><\/li><\/ul><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ultering.com\/it4us\/?p=7210\/#NAVIGATION\" title=\"NAVIGATION\">NAVIGATION<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"TARGET\"><\/span>TARGET<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Modal&#8217;s stuff in general.<\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"NGX-BOOTSTRAP_MODAL\"><\/span>NGX-BOOTSTRAP MODAL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"Closing_the_Modal_Returns_Failure\"><\/span>Closing the Modal Returns Failure<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-7217\" src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0.jpg\" alt width=\"1673\" height=\"391\" srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0.jpg 1673w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0-300x70.jpg 300w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0-768x179.jpg 768w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0-1536x359.jpg 1536w\" sizes=\"(max-width: 1673px) 100vw, 1673px\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-7217 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201673%20391%22%3E%3C%2Fsvg%3E\" alt width=\"1673\" height=\"391\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201673%20391%22%3E%3C%2Fsvg%3E 1673w\" sizes=\"(max-width: 1673px) 100vw, 1673px\" data-srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0.jpg 1673w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0-300x70.jpg 300w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0-768x179.jpg 768w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0-1536x359.jpg 1536w\" data-src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide_0.jpg\"><\/p>\n<p>&nbsp;<\/p>\n<pre class>ERROR TypeError: Cannot read properties of undefined (reading 'hide')\n    at main.js:1:434209\n    at UT (main.js:1:69900)\n    at s (main.js:1:70062)\n    at HTMLButtonElement.&lt;anonymous&gt;\n<\/pre>\n<p>&nbsp;<\/p>\n<p><noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-7216\" src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide.jpg\" alt width=\"1708\" height=\"538\" srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide.jpg 1708w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide-300x94.jpg 300w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide-768x242.jpg 768w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide-1536x484.jpg 1536w\" sizes=\"(max-width: 1708px) 100vw, 1708px\"><\/noscript><img decoding=\"async\" class=\"alignnone size-full wp-image-7216 lazyload\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201708%20538%22%3E%3C%2Fsvg%3E\" alt width=\"1708\" height=\"538\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201708%20538%22%3E%3C%2Fsvg%3E 1708w\" sizes=\"(max-width: 1708px) 100vw, 1708px\" data-srcset=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide.jpg 1708w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide-300x94.jpg 300w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide-768x242.jpg 768w, https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide-1536x484.jpg 1536w\" data-src=\"https:\/\/ultering.com\/it4us\/wp-content\/uploads\/angularx_ngx_bootstrap_modal_error_typeerror__cannot_read_properties_of_undefined_reading_hide.jpg\"><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"SOLUTION\"><\/span>SOLUTION<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"BEFORE\"><\/span>BEFORE<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>The new modal component code:<\/p>\n<pre class>import { Component, OnInit, TemplateRef } from '@angular\/core';\nimport { BsModalRef, BsModalService } from 'ngx-bootstrap\/modal';\n\n@Component({\n  selector: 'app-deltodo',\n  templateUrl: '.\/deltodo.component.html',\n  styleUrls: ['.\/deltodo.component.scss'],\n})\nexport class DeltodoComponent implements OnInit {\n\n  modalRef: BsModalRef;\n  title: string;\n  \/\/ list: any[] = [];\n\n  constructor() {}\n\n\n  ngOnInit(): void {}\n\n}\n\n<\/pre>\n<h4><span class=\"ez-toc-section\" id=\"AFTER\"><\/span>AFTER<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>The modal component code:<\/p>\n<p>&nbsp;<\/p>\n<pre class>import { Component, OnInit, TemplateRef } from '@angular\/core';\nimport { BsModalRef, BsModalService } from 'ngx-bootstrap\/modal';\n\n@Component({\n  selector: 'app-deltodo',\n  templateUrl: '.\/deltodo.component.html',\n  styleUrls: ['.\/deltodo.component.scss'],\n})\nexport class DeltodoComponent implements OnInit {\n\n  title: string;\n\n  constructor(public modalRef: BsModalRef) {}\n\n  ngOnInit(): void {}\n\n}\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"NAVIGATION\"><\/span>NAVIGATION<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=7175\">Angular From Scratch Tutorial &#8211; Index<\/a><\/p>\n<p><a href=\"https:\/\/ultering.com\/it4us\/?p=7177\">Angular From Scratch Tutorial \u2013 Step 8: Miscellany<\/a><\/p>\n<p>&nbsp;<\/p>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Angular From Scratch Tutorial &#8211; Index Angular From Scratch Tutorial \u2013 Step 8: Miscellany TARGET Modal&#8217;s stuff in general. &nbsp; NGX-BOOTSTRAP MODAL Closing the Modal Returns Failure &nbsp; ERROR TypeError: Cannot read properties of undefined (reading &#8216;hide&#8217;) at main.js:1:434209 at UT (main.js:1:69900) at s (main.js:1:70062) at HTMLButtonElement.&lt;anonymous&gt; &nbsp; &nbsp; SOLUTION BEFORE The new modal component &#8230; <a href=\"https:\/\/ultering.com\/it4us\/?p=7210\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &#8220;Angular From Scratch Tutorial \u2013 Step 9: Modal&#8221;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[192,26],"tags":[],"class_list":["post-7210","post","type-post","status-publish","format-standard","hentry","category-angular","category-javascript"],"_links":{"self":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/7210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7210"}],"version-history":[{"count":5,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/7210\/revisions"}],"predecessor-version":[{"id":7219,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/7210\/revisions\/7219"}],"wp:attachment":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}