{"id":52787,"date":"2020-06-15T08:00:42","date_gmt":"2020-06-15T06:00:42","guid":{"rendered":"https:\/\/code-maze.com\/?p=52787"},"modified":"2022-06-15T13:53:41","modified_gmt":"2022-06-15T11:53:41","slug":"blazor-components","status":"publish","type":"post","link":"https:\/\/code-maze.com\/blazor-components\/","title":{"rendered":"Blazor Components with Arbitrary and Cascading Parameters"},"content":{"rendered":"<p>Blazor components are reusable parts of the application containing the logic for the user interface creation. So, everything in our application could be a component. A home page, registration, login form, error page, you name it. It&#8217;s recommended to always use components to split the application\u2019s logic into smaller reusable\/maintainable parts.<\/p>\n<p>In this article, we are going to learn about creating components and how to pass different kinds of parameters to them. Additionally, we are going to learn how to debug the Blazor WebAssembly application using our browser.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit the <a href=\"https:\/\/github.com\/CodeMazeBlog\/blazor-series\/tree\/blazor-webassembly-components\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Blazor Components repository<\/a>.<\/div>\n<p>For the complete navigation for this series, you can visit the <a href=\"https:\/\/code-maze.com\/blazor-webassembly-series\/\" target=\"_blank\" rel=\"noopener noreferrer\">Blazor WebAssembly Series page<\/a>.<\/p>\n<p>Now, it&#8217;s time to dive into the project.<\/p>\n<h2 id=\"blazor-components\">Working With Blazor Components<\/h2>\n<p>Let\u2019s start by creating a new Blazor WebAssembly application as we did in <a href=\"https:\/\/code-maze.com\/blazor-webassembly-introduction\/\" target=\"_blank\" rel=\"noopener noreferrer\">the previous article<\/a>. We are going to name it BlazorProducts.Client:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/08-Created-BlazorClient-app.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52788\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/08-Created-BlazorClient-app.png\" alt=\"Blazor WebAssembly Project Structure\" width=\"278\" height=\"198\" \/><\/a><\/p>\n<p>While creating this project, you can find the \u201cASP.NET Core hosted\u201d checkbox on the lower-right side of the window.\u00a0 By checking this checkbox, Visual Studio creates an additional Razor project for our client project automatically. We didn\u2019t check it because we want to create only the client side project. Later on, we will create our separate Web API project.<\/p>\n<p>That said, let\u2019s continue by creating a new <code>Components<\/code> folder at the root of the project. Then, let\u2019s right-click on that folder and choose <code>Add New Item<\/code>. In the new window, we are going to choose the Razor Component option, and name it <code>Home.razor<\/code>:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/09-Home-component-creation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52789\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/09-Home-component-creation.png\" alt=\"Creating Razor Component file\" width=\"968\" height=\"441\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/09-Home-component-creation.png 968w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/09-Home-component-creation-300x137.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/09-Home-component-creation-768x350.png 768w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/a><\/p>\n<p>As soon as we create this component, we are going to see it consists of two parts:<\/p>\n<ul>\n<li>HTML part &lt;h3&gt;Home&lt;\/h3&gt; and<\/li>\n<li>The @code part<\/li>\n<\/ul>\n<p>In the HTML part, we are going to add the UI code and in the @code part, we are going to write the C# code. A component doesn\u2019t require the @code part to be a valid component, it can run without it for sure. But when we want to use fields, properties, methods, and the C# business logic overall, it is the best practice to add them to the @code block and separate them from the markup logic.\u00a0<\/p>\n<p>Now, let\u2019s add the <code>assets<\/code> folder in the <code>wwwroot<\/code> folder and inside it a single picture (you can use any picture you want):<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/10-Assets-folder-with-a-picture.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52790\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/10-Assets-folder-with-a-picture.png\" alt=\"Adding picture for the Blazor Components project\" width=\"156\" height=\"128\" \/><\/a><\/p>\n<p>Then, let\u2019s modify the <code>Home.razor<\/code> file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">&lt;div style=\"text-align:center\"&gt;\r\n    &lt;h1&gt;\r\n        Welcome to the BlazorProducts.Client application.\r\n    &lt;\/h1&gt;\r\n    &lt;p&gt;\r\n        Feel free to \r\n        &lt;a href=\"https:\/\/www.redbubble.com\/people\/vpecanac\/works\/44764889-code-maze-merch?asc=u\" target=\"_blank\"&gt;visit our shop&lt;\/a&gt;\r\n        any time you want.\r\n    &lt;\/p&gt;\r\n    &lt;p&gt;\r\n        &lt;img src=\"\/assets\/products.png\" alt=\"products image for the Home component\" class=\"img-fluid\" \/&gt;\r\n    &lt;\/p&gt;    \r\n&lt;\/div&gt;\r\n\r\n@code {\r\n\r\n}\r\n<\/pre>\n<p>Now, we can open the <code>Index.razor<\/code> file, remove everything from it except the <code>@page<\/code> directive and apply our newly created component:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-highlight=\"2,4\">@page \"\/\"\r\n@using BlazorProducts.Client.Components \r\n\r\n&lt;Home&gt;&lt;\/Home&gt;\r\n<\/pre>\n<p>We apply the <code>@using<\/code> directive in this file because we are going to use the <code>Home<\/code> component only in this file. But, if we want to share our component with multiple files, we can apply the using directive in the <code>_Imports.razor<\/code> file.<\/p>\n<p>Additionally, to add the component to another file, we use a tag syntax with the name of the component.<\/p>\n<p>That\u2019s all it takes. But before we start our application, let\u2019s remove the IIS profile from the <code>launchSettings.json<\/code> file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">{\r\n  \"profiles\": {\r\n    \"BlazorProducts.Client\": {\r\n      \"commandName\": \"Project\",\r\n      \"dotnetRunMessages\": \"true\",\r\n      \"launchBrowser\": true,\r\n      \"inspectUri\": \"{wsProtocol}:\/\/{url.hostname}:{url.port}\/_framework\/debug\/ws-proxy?browser={browserInspectUri}\",\r\n      \"applicationUrl\": \"https:\/\/localhost:5001;http:\/\/localhost:5000\",\r\n      \"environmentVariables\": {\r\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\"\r\n      }\r\n    }\r\n  }\r\n}<\/pre>\n<p>Excellent. Now, let\u2019s start our application:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52791\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component.png\" alt=\"Home Blazor Component after the project starts\" width=\"1111\" height=\"729\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component.png 1111w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component-300x197.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component-1024x672.png 1024w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component-768x504.png 768w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/11-App-started-Home-component-1080x709.png 1080w\" sizes=\"auto, (max-width: 1111px) 100vw, 1111px\" \/><\/a><\/p>\n<p>There we go. We can see our application is working and our component is displayed on the page.<\/p>\n<p>But, this is just a part of the whole Blazor Components story. So, let\u2019s move on.<\/p>\n<h2 id=\"sending-parameters\">Sending Parameters to the Blazor Components<\/h2>\n<p>Often, we need to create reusable components that accept different parameters and show content based on those parameters. So, to show how to do that, let\u2019s modify our <code>Home<\/code> component:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"3,16,17\">&lt;div style=\"text-align:center\"&gt;\r\n    &lt;h1&gt;\r\n        @Title\r\n    &lt;\/h1&gt;\r\n    &lt;p&gt;\r\n        Feel free to \r\n        &lt;a href=\"https:\/\/www.redbubble.com\/people\/vpecanac\/works\/44764889-code-maze-merch?asc=u\" target=\"_blank\"&gt;visit our shop&lt;\/a&gt;\r\n        any time you want.\r\n    &lt;\/p&gt;\r\n    &lt;p&gt;\r\n        &lt;img src=\"\/assets\/products.png\" alt=\"products image for the Home component\" class=\"img-fluid\" \/&gt;\r\n    &lt;\/p&gt;    \r\n&lt;\/div&gt;\r\n\r\n@code {\r\n    [Parameter]\r\n    public string Title { get; set; }\r\n}\r\n<\/pre>\n<p>With the <code>@Title<\/code> expression, we are using a one-way binding to bind the value from the <code>Title<\/code> property (from the @code section) to the HTML. As we can see, if we want to mark any property as a component parameter, we have to decorate it with the <code>[Parameter]<\/code> attribute.<\/p>\n<p>We can use different kinds of data for the parameters, even events, and the razor code. It depends on the usage of our component and what we want to accomplish with the component parameters. Take note that we are explicitly stating \u201ccomponent parameters\u201d because we have the routing parameters as well.<\/p>\n<p>We are going to talk more about them in the next article.<\/p>\n<p>Now, to complete the process, we have to modify the <code>Index<\/code> page:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"4\">@page \"\/\"\r\n@using BlazorProducts.Client.Components \r\n\r\n&lt;Home Title=\"Welcome to the BlazorProducts.Client application.\"&gt;&lt;\/Home&gt;\r\n<\/pre>\n<p>To send the value to the <code>Title<\/code> property in the <code>Home<\/code> component, we use the <code>Title<\/code> attribute. Blazor provides us a nice IntelliSense for that:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/12-Blazor-intellisense-for-the-Title.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52792\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/12-Blazor-intellisense-for-the-Title.png\" alt=\"Blazor intellisense\" width=\"294\" height=\"188\" \/><\/a><\/p>\n<p>After this change, we can start our application again, and inspect the result:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52793\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter.png\" alt=\"Blazor Home Component with the Title parameter\" width=\"1116\" height=\"639\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter.png 1116w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter-300x172.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter-1024x586.png 1024w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter-768x440.png 768w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/13-Title-populated-with-Parameter-1080x618.png 1080w\" sizes=\"auto, (max-width: 1116px) 100vw, 1116px\" \/><\/a><\/p>\n<p>We can see that nothing has changed in the UI. But now, we are using component parameters to display the Title.<\/p>\n<h2 id=\"arbitrary-parameters\">Arbitrary Parameters in Blazor Components<\/h2>\n<p>Blazor components can accept additional attributes that are not declared as the component parameters. For example, our component has an image tag with the <code>src<\/code> and <code>alt<\/code> attributes hardcoded. But if we want to reuse this whole component, we have to provide the user with the possibility to add their picture with the alternative text.<\/p>\n<p>In the previous section, we used the <code>[Parameter]<\/code> attribute to send a parameter that is related to the component itself. But now, we have two attributes related to the <code>img<\/code> tag inside the component. So, there is a better way to pass these attributes to the component using Arbitrary Parameters.<\/p>\n<p>Let\u2019s remove the <code>src<\/code> and <code>alt<\/code> attributes from the image tag and add a parameter in the <code>Home<\/code> component:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"11,19,29\">&lt;div style=\"text-align:center\"&gt;\r\n    &lt;h1&gt;\r\n        @Title\r\n    &lt;\/h1&gt;\r\n    &lt;p&gt;\r\n        Feel free to \r\n        &lt;a href=\"https:\/\/www.redbubble.com\/people\/vpecanac\/works\/44764889-code-maze-merch?asc=u\" target=\"_blank\"&gt;visit our shop&lt;\/a&gt;\r\n        any time you want.\r\n    &lt;\/p&gt;\r\n    &lt;p&gt;\r\n        &lt;img class=\"img-fluid\" \/&gt;\r\n    &lt;\/p&gt;    \r\n&lt;\/div&gt;\r\n\r\n@code {\r\n    [Parameter]\r\n    public string Title { get; set; }\r\n\r\n    [Parameter(CaptureUnmatchedValues = true)]\r\n    public Dictionary&lt;string, object&gt; AdditionalAttributes { get; set; }\r\n}\r\n<\/pre>\n<p>This parameter implements <code>Dictionary&lt;string, object&gt;<\/code> type and it has an additional <code>CaptureUnmatchedValues<\/code> property. With this property, if it&#8217;s set to true, we state that this parameter shall handle all the values that don\u2019t match any other parameter in this component.<\/p>\n<p>To apply this, we have to add <code>@attributes<\/code> attribute to the image tag:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">&lt;p&gt;\r\n    &lt;img @attributes=\"AdditionalAttributes\" class=\"img-fluid\" \/&gt;\r\n&lt;\/p&gt;\r\n<\/pre>\n<p>And send the values from the <code>Index<\/code> page:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-highlight=\"4-5\">@page \"\/\"\r\n@using BlazorProducts.Client.Components \r\n\r\n&lt;Home Title=\"Welcome to the BlazorProducts.Client application.\" \r\n      src=\"\/assets\/products.png\" alt=\"products image for the Home component\"&gt;&lt;\/Home&gt;\r\n<\/pre>\n<p>Now, we can start the application and verify that everything is working as it supposed to. But let\u2019s improve this solution a bit. Let\u2019s create a new property in the <code>Index<\/code> page and use it to send our attributes to the <code>Home<\/code> component:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"4,7-11\">@page \"\/\"\r\n@using BlazorProducts.Client.Components \r\n\r\n&lt;Home Title=\"Welcome to the BlazorProducts.Client application.\" @attributes=\"AdditionalAttributes\"&gt;&lt;\/Home&gt;\r\n\r\n@code{\r\n    public Dictionary&lt;string, object&gt; AdditionalAttributes { get; set; } = new Dictionary&lt;string, object&gt;\r\n    {\r\n        { \"src\", \"\/assets\/products.png\" },\r\n        { \"alt\", \"products image for the Home component\" }\r\n    };\r\n}<\/pre>\n<p>With this solution, we can add more attributes in a more readable way. As a result, we can see those arbitrary parameters are useful when we define a component with a markup element that supports a variety of customizations.<\/p>\n<h2 id=\"cascading-parameters\">Cascading Parameters<\/h2>\n<p>In some situations, we want to pass a parameter from a parent component to all the child components. To do that, we can use Cascading Parameters.<\/p>\n<p>Let\u2019s see how this works with an example.<\/p>\n<p>First, let\u2019s open the <code>Shared\/MainLayout.razor<\/code> file and add some modifications to it:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"14-16,21-23\">@inherits LayoutComponentBase\r\n\r\n&lt;div class=\"page\"&gt;\r\n    &lt;div class=\"sidebar\"&gt;\r\n        &lt;NavMenu \/&gt;\r\n    &lt;\/div&gt;\r\n\r\n    &lt;div class=\"main\"&gt;\r\n        &lt;div class=\"top-row px-4\"&gt;\r\n            &lt;a href=\"http:\/\/blazor.net\" target=\"_blank\" class=\"ml-md-auto\"&gt;About&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n\r\n        &lt;div class=\"content px-4\"&gt;\r\n            &lt;CascadingValue Value=\"@_color\"&gt;\r\n                @Body\r\n            &lt;\/CascadingValue&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n\r\n@code {\r\n    private readonly string _color = \"#0505b5\";\r\n}<\/pre>\n<p>This is the layout component that renders all our project pages inside the <code>@Body<\/code> part. To apply the cascading parameter, we have to wrap the <code>@Body<\/code> content inside the <code>CascadingValue<\/code> component and pass a value with the <code>Value<\/code> attribute. We want to use this parameter inside the <code>Home<\/code> component, so let\u2019s modify it as well:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"2,23,24\">&lt;div style=\"text-align:center\"&gt;\r\n    &lt;h1 style=\"color: @Color\"&gt;\r\n        @Title\r\n    &lt;\/h1&gt;\r\n    &lt;p&gt;\r\n        Feel free to \r\n        &lt;a href=\"https:\/\/www.redbubble.com\/people\/vpecanac\/works\/44764889-code-maze-merch?asc=u\" target=\"_blank\"&gt;visit our shop&lt;\/a&gt;\r\n        any time you want.\r\n    &lt;\/p&gt;\r\n    &lt;p&gt;\r\n        &lt;img @attributes=\"AdditionalAttributes\" class=\"img-fluid\" \/&gt;\r\n    &lt;\/p&gt;\r\n    \r\n&lt;\/div&gt;\r\n\r\n@code {\r\n    [Parameter]\r\n    public string Title { get; set; }\r\n\r\n    [Parameter(CaptureUnmatchedValues = true)]\r\n    public Dictionary&lt;string, object&gt; AdditionalAttributes { get; set; }\r\n\r\n    [CascadingParameter]\r\n    public string Color { get; set; }\r\n}\r\n<\/pre>\n<p>In the <code>@code<\/code> part, we add the <code>Color<\/code> property with the <code>[CascadingParameter]<\/code> attribute. This attribute specifies that the <code>Color<\/code> property should receive a value from the <code>CascadingValue<\/code> component. After that, we just modify the style of our <code>h1<\/code> tag. Additionally, when we want to pass more than one value as a cascading parameter, we can create a new object with multiple properties and pass that object with the <code>Value<\/code> attribute to all the child components.<\/p>\n<p>We have to mention that here we use <strong>cascading values by type<\/strong>. For this to work, several conditions must be fulfilled:<\/p>\n<ul>\n<li>We must decorate the <code>Color<\/code> property with the <code>CascadingParameter<\/code> attribute<\/li>\n<li>It must have a setter and be public<\/li>\n<li>Its type must be the same as the type in the <code>CascadingValue<\/code> component (in this example of type string)<\/li>\n<\/ul>\n<p>Now, if we inspect our result, we can see the <code>h1<\/code> color is modified:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/14-Cascading-param-h1-color.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52798\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/14-Cascading-param-h1-color.png\" alt=\"Using cascading parameters in Blazor Components\" width=\"924\" height=\"211\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/14-Cascading-param-h1-color.png 924w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/14-Cascading-param-h1-color-300x69.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/14-Cascading-param-h1-color-768x175.png 768w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/a><\/p>\n<p>Next to the cascading values by type, which we just used, we can use the cascading values by name. For that, we have to add a new <code>Name<\/code> attribute to the <code>CascadingValue<\/code> component:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">&lt;CascadingValue Name=\"HeadingColor\" Value=\"@_color\"&gt; \r\n    @Body \r\n&lt;\/CascadingValue&gt;<\/pre>\n<p>Also, we have to modify the <code>CascadingParameter<\/code> attribute:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"1\">[CascadingParameter(Name = \"HeadingColor\")]\r\npublic string Color { get; set; }<\/pre>\n<p>The name of the property (Color) that consumes the value is irrelevant here.\u00a0 The Blazor is going to look for the property that has the <code>CascadingParameter<\/code> attribute with the <code>Name<\/code> property the same as the <code>Name<\/code> property in the <code>CascadingValue<\/code> component.<\/p>\n<h2 id=\"debugging\">Debugging Blazor WebAssembly Applications<\/h2>\n<p>From the BlazorWebAssembly preview 3, there is a possibility to debug the Blazor client application using the Visual Studio IDE. To enable it, we have to use the Blazor WebAssembly project template preview 3 or later, and the latest preview release of Visual Studio 2019 16.6 (preview 2 or later).<\/p>\n<p>With these in place, as soon as we inspect the <code>launchSettings.json<\/code> file, we are going to find a new <strong>inspectUri<\/strong> property. It enables IDE to identify that our application is the Blazor WebAssembly application and to instruct the debugging infrastructure to connect the browser through Blazor\u2019s debugging proxy:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-highlight=\"7\">{\r\n  \"profiles\": {\r\n    \"BlazorProducts.Client\": {\r\n      \"commandName\": \"Project\",\r\n      \"dotnetRunMessages\": \"true\",\r\n      \"launchBrowser\": true,\r\n      \"inspectUri\": \"{wsProtocol}:\/\/{url.hostname}:{url.port}\/_framework\/debug\/ws-proxy?browser={browserInspectUri}\",\r\n      \"applicationUrl\": \"https:\/\/localhost:5001;http:\/\/localhost:5000\",\r\n      \"environmentVariables\": {\r\n        \"ASPNETCORE_ENVIRONMENT\": \"Development\"\r\n      }\r\n    }\r\n  }\r\n}<\/pre>\n<p>All we have to do is to set a breakpoint in our C# code and start the application with debugging support (F5). The rest of the process is the same.<\/p>\n<h3>Debugging in the Browser<\/h3>\n<p>Additionally, we can always debug our Blazor WebAssembly application in a browser.<\/p>\n<p><strong>Important Note:\u00a0<\/strong>If you are using .NET Core 3.1, you can proceed with the following example. <strong>But if you are using .NET 5 or above<\/strong>, before you start with the example below, you have to modify the <code>launchSettings.json<\/code> file by setting the <code>launchBrowser<\/code> property to <code>false<\/code>. This will prevent the &#8220;WebSocket disconnected&#8221; error. After that, you can continue with the debugging example.<\/p>\n<p>To do that, let\u2019s start our application (F5), and as soon as the application starts in the browser, press the <code>Shift+Alt+D<\/code> keys. This should open a new tab with the instruction messages:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/15-Client-debug-instruction-messages.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52799\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/15-Client-debug-instruction-messages.png\" alt=\"Client debug instruction messages\" width=\"1018\" height=\"430\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/15-Client-debug-instruction-messages.png 1018w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/15-Client-debug-instruction-messages-300x127.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/15-Client-debug-instruction-messages-768x324.png 768w\" sizes=\"auto, (max-width: 1018px) 100vw, 1018px\" \/><\/a><\/p>\n<p>So, let\u2019s do as it states for the Google Chrome browser because we are using it for this series.<\/p>\n<p>We have to copy the marked command and paste it into the Run window and press the OK button:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/16-Run-window-command.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52800\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/16-Run-window-command.png\" alt=\"Run window command\" width=\"401\" height=\"208\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/16-Run-window-command.png 401w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/16-Run-window-command-300x156.png 300w\" sizes=\"auto, (max-width: 401px) 100vw, 401px\" \/><\/a><\/p>\n<p>As soon as we do that, a new browser window will open with our application. All we have to do is to press again the Shift+Alt+D keys and the DevTools tab will open. Let\u2019s navigate to the Source tab and press Ctrl+P, type Counter, and press the Enter key. This will open the Counter razor file for us and we can place a breakpoint at the code line we want to debug:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/17-Debug-window-prepared.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52801\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/17-Debug-window-prepared.png\" alt=\"Blazor Debug window prepared\" width=\"941\" height=\"706\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/17-Debug-window-prepared.png 941w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/17-Debug-window-prepared-300x225.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/17-Debug-window-prepared-768x576.png 768w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/a><\/p>\n<p>Now, we can click the <code>Click me<\/code> button and that is going to trigger our breakpoint. Once we press F10, the process will move to another line and in the Local tab, we can inspect the value of the <code>currentCount<\/code> variable:<\/p>\n<p><a href=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/18-Debugging-in-action.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52802\" src=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/18-Debugging-in-action.png\" alt=\"Inspecting the value in the debugging window for Blazor application\" width=\"942\" height=\"739\" srcset=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/18-Debugging-in-action.png 942w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/18-Debugging-in-action-300x235.png 300w, https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/18-Debugging-in-action-768x602.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/a><\/p>\n<p>And, that\u2019s all it takes. We can debug our application and inspect the results as well.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>In this article, we have learned:<\/p>\n<ul>\n<li>How to create Blazor components<\/li>\n<li>The way to use parameters to pass different values to the component<\/li>\n<li>How to use Cascading parameters to share parameters between multiple child components<\/li>\n<li>And the way to debug our client application<\/li>\n<\/ul>\n<p>In the next article, we are going to learn about <a href=\"https:\/\/code-maze.com\/partial-classes-renderfragment-lifecycle-blazor-wasm\/\" target=\"_blank\" rel=\"noopener noreferrer\">the Partial classes, RenderFragment parameters, and the Lifecycle methods<\/a> in the Blazor applications.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Blazor components are reusable parts of the application containing the logic for the user interface creation. So, everything in our application could be a component. A home page, registration, login form, error page, you name it. It&#8217;s recommended to always use components to split the application\u2019s logic into smaller reusable\/maintainable parts. In this article, we [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":55044,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[684,12],"tags":[689,685,688,686,690,691],"class_list":["post-52787","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blazor-webassembly","category-csharp","tag-arbitrary-parameters","tag-blazor","tag-blazor-components","tag-blazor-webassembly","tag-cascading-parameters","tag-debugging-blazor-webassembly-application","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Blazor Components with Arbitrary and Cascading Parameters - Code Maze<\/title>\n<meta name=\"description\" content=\"Let&#039;s learn how to create and use the Blazor Components to make our code more reusable and readable. Also, we will use Arbitrary and Cascading parameters.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/blazor-components\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blazor Components with Arbitrary and Cascading Parameters - Code Maze\" \/>\n<meta property=\"og:description\" content=\"Let&#039;s learn how to create and use the Blazor Components to make our code more reusable and readable. Also, we will use Arbitrary and Cascading parameters.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/blazor-components\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-15T06:00:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-15T11:53:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Marinko Spasojevi\u0107\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marinko Spasojevi\u0107\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/blazor-components\/\"},\"author\":{\"name\":\"Marinko Spasojevi\u0107\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/d6fa06e66820968d19b39fb63cff2533\"},\"headline\":\"Blazor Components with Arbitrary and Cascading Parameters\",\"datePublished\":\"2020-06-15T06:00:42+00:00\",\"dateModified\":\"2022-06-15T11:53:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/blazor-components\/\"},\"wordCount\":1803,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png\",\"keywords\":[\"Arbitrary Parameters\",\"Blazor\",\"Blazor Components\",\"Blazor WebAssembly\",\"Cascading Parameters\",\"Debugging Blazor WebAssembly Application\"],\"articleSection\":[\"Blazor WebAssembly\",\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/blazor-components\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/blazor-components\/\",\"url\":\"https:\/\/code-maze.com\/blazor-components\/\",\"name\":\"Blazor Components with Arbitrary and Cascading Parameters - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png\",\"datePublished\":\"2020-06-15T06:00:42+00:00\",\"dateModified\":\"2022-06-15T11:53:41+00:00\",\"description\":\"Let's learn how to create and use the Blazor Components to make our code more reusable and readable. Also, we will use Arbitrary and Cascading parameters.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/blazor-components\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png\",\"width\":1100,\"height\":620,\"caption\":\"02 blazor components\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/blazor-components\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blazor Components with Arbitrary and Cascading Parameters\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/d6fa06e66820968d19b39fb63cff2533\",\"name\":\"Marinko Spasojevi\u0107\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/marinko-1x1-3-150x150.jpg\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/marinko-1x1-3-150x150.jpg\",\"caption\":\"Marinko Spasojevi\u0107\"},\"description\":\"Hi, my name is Marinko Spasojevic. Currently, I work as a full-time .NET developer and my passion is web application development. Just getting something to work is not enough for me. To make it just how I like it, it must be readable, reusable, and easy to maintain. Prior to being an author on the CodeMaze blog, I had been working as a professor of Computer Science for several years. So, sharing knowledge while working as a full-time developer comes naturally to me.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/marinko-spasojevic\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/marinko\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Blazor Components with Arbitrary and Cascading Parameters - Code Maze","description":"Let's learn how to create and use the Blazor Components to make our code more reusable and readable. Also, we will use Arbitrary and Cascading parameters.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/code-maze.com\/blazor-components\/","og_locale":"en_US","og_type":"article","og_title":"Blazor Components with Arbitrary and Cascading Parameters - Code Maze","og_description":"Let's learn how to create and use the Blazor Components to make our code more reusable and readable. Also, we will use Arbitrary and Cascading parameters.","og_url":"https:\/\/code-maze.com\/blazor-components\/","og_site_name":"Code Maze","article_published_time":"2020-06-15T06:00:42+00:00","article_modified_time":"2022-06-15T11:53:41+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png","type":"image\/png"}],"author":"Marinko Spasojevi\u0107","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Marinko Spasojevi\u0107","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/blazor-components\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/blazor-components\/"},"author":{"name":"Marinko Spasojevi\u0107","@id":"https:\/\/code-maze.com\/#\/schema\/person\/d6fa06e66820968d19b39fb63cff2533"},"headline":"Blazor Components with Arbitrary and Cascading Parameters","datePublished":"2020-06-15T06:00:42+00:00","dateModified":"2022-06-15T11:53:41+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/blazor-components\/"},"wordCount":1803,"commentCount":6,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/blazor-components\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png","keywords":["Arbitrary Parameters","Blazor","Blazor Components","Blazor WebAssembly","Cascading Parameters","Debugging Blazor WebAssembly Application"],"articleSection":["Blazor WebAssembly","C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/blazor-components\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/blazor-components\/","url":"https:\/\/code-maze.com\/blazor-components\/","name":"Blazor Components with Arbitrary and Cascading Parameters - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/blazor-components\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/blazor-components\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png","datePublished":"2020-06-15T06:00:42+00:00","dateModified":"2022-06-15T11:53:41+00:00","description":"Let's learn how to create and use the Blazor Components to make our code more reusable and readable. Also, we will use Arbitrary and Cascading parameters.","breadcrumb":{"@id":"https:\/\/code-maze.com\/blazor-components\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/blazor-components\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/blazor-components\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/06\/02-blazor-components.png","width":1100,"height":620,"caption":"02 blazor components"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/blazor-components\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Blazor Components with Arbitrary and Cascading Parameters"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/d6fa06e66820968d19b39fb63cff2533","name":"Marinko Spasojevi\u0107","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/marinko-1x1-3-150x150.jpg","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/marinko-1x1-3-150x150.jpg","caption":"Marinko Spasojevi\u0107"},"description":"Hi, my name is Marinko Spasojevic. Currently, I work as a full-time .NET developer and my passion is web application development. Just getting something to work is not enough for me. To make it just how I like it, it must be readable, reusable, and easy to maintain. Prior to being an author on the CodeMaze blog, I had been working as a professor of Computer Science for several years. So, sharing knowledge while working as a full-time developer comes naturally to me.","sameAs":["https:\/\/www.linkedin.com\/in\/marinko-spasojevic\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/marinko\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/52787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=52787"}],"version-history":[{"count":6,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/52787\/revisions"}],"predecessor-version":[{"id":71718,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/52787\/revisions\/71718"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/55044"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=52787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=52787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=52787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}