<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ko - Tag Vibe</title>
	<atom:link href="https://www.tagvibe.com/tag/ko/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tagvibe.com</link>
	<description>Connect. Create. Conquer.</description>
	<lastBuildDate>Mon, 06 May 2024 09:17:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://www.tagvibe.com/wp-content/uploads/2024/05/cropped-cropped-logo-tagvibe-1-32x32.png</url>
	<title>ko - Tag Vibe</title>
	<link>https://www.tagvibe.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to set &#8216;if&#8217;, &#8216;else&#8217;, &#8216;and&#8217; conditions in knockout js Magento 2?</title>
		<link>https://www.tagvibe.com/how-to-set-if-else-and-conditions-in-knockout-js-magento-2/</link>
		
		<dc:creator><![CDATA[Rajat kar]]></dc:creator>
		<pubDate>Mon, 29 Nov 2021 20:23:47 +0000</pubDate>
				<category><![CDATA[Magento2]]></category>
		<category><![CDATA[conditional-statement]]></category>
		<category><![CDATA[ko]]></category>
		<category><![CDATA[ko-template]]></category>
		<guid isPermaLink="false">https://tagvibe.com/?p=186</guid>

					<description><![CDATA[<p>This post will give you the idea in certain ways to use if else, and condition in knockout JS in Magento 2 If else conditions in KO template If else conditions in KO template with &#38;&#38; operator</p>
<p>The post <a href="https://www.tagvibe.com/how-to-set-if-else-and-conditions-in-knockout-js-magento-2/">How to set ‘if’, ‘else’, ‘and’ conditions in knockout js Magento 2?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="gtfy-12">This post will give you the idea in certain ways to use if else, and condition in knockout JS in Magento 2</p>



<p class="gtfy-15"><strong>If else conditions in KO template</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-18" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;!-- ko if: myData --&gt;
..if statement goes here
&lt;!-- /ko --&gt;
&lt;!-- ko if: !(myData) --&gt;
..else statement goes here
&lt;!-- /ko --&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #D8DEE9">myData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">..</span><span style="color: #D8DEE9">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">statement</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">goes</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">here</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9FF">(</span><span style="color: #D8DEE9">myData</span><span style="color: #D8DEE9FF">) </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">..</span><span style="color: #D8DEE9">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">statement</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">goes</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">here</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span></code></pre></div>



<p class="gtfy-21"><strong>If else conditions in KO template with <em>&amp;&amp;</em> operator</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro gtfy-24" style="font-size:.875rem;line-height:1.25rem"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="&lt;!-- ko if: X &amp;&amp; Y --&gt;
//your code
&lt;!-- /ko --&gt;

&lt;!-- ko if: X &amp;&amp; !Y --&gt;
//your code
&lt;!-- /ko --&gt;

&lt;!-- ko if: !X &amp;&amp; !Y --&gt;
 //your code
 &lt;!-- /ko --&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff"><code><span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #D8DEE9">X</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">Y</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #616E88">//your code</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #D8DEE9">X</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9">Y</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #616E88">//your code</span></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF">: </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9">X</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9">Y</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span>
<span class="line"><span style="color: #ECEFF4"> </span><span style="color: #616E88">//your code</span></span>
<span class="line"><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;!--</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">ko</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--&gt;</span></span></code></pre></div><p>The post <a href="https://www.tagvibe.com/how-to-set-if-else-and-conditions-in-knockout-js-magento-2/">How to set ‘if’, ‘else’, ‘and’ conditions in knockout js Magento 2?</a> first appeared on <a href="https://www.tagvibe.com">Tag Vibe</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
