<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Angular on Rowanto Luo</title><link>https://log.rowanto.com/categories/angular/</link><description>Recent content in Angular on Rowanto Luo</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 31 Oct 2014 00:38:51 +0000</lastBuildDate><atom:link href="https://log.rowanto.com/categories/angular/index.xml" rel="self" type="application/rss+xml"/><item><title>Why your cancel button submit the html form</title><link>https://log.rowanto.com/posts/why-your-cancel-button-submit-the-html-form/</link><pubDate>Fri, 31 Oct 2014 00:38:51 +0000</pubDate><guid>https://log.rowanto.com/posts/why-your-cancel-button-submit-the-html-form/</guid><description>
&lt;p&gt;One of the mistake which I see often during development on the frontend side is the cancel button, which actually submits the form when clicked. Saw it once, wait a while, saw it again, wait a while, saw it again, and the loop continues. Some people doesn&amp;rsquo;t even realize.&lt;/p&gt;
&lt;p&gt;So what&amp;rsquo;s the problem? Let&amp;rsquo;s take a look at a normal html form in AngularJS.
HTML Code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div ng-app=&amp;quot;MyApp&amp;quot;&amp;gt;
&amp;lt;div ng-controller=&amp;quot;MyController&amp;quot;&amp;gt;
&amp;lt;form ng-submit=&amp;quot;submitTheForm()&amp;quot;&amp;gt;
&amp;lt;div class=&amp;quot;form-group&amp;quot;&amp;gt;
&amp;lt;label for=&amp;quot;name&amp;quot;&amp;gt;Name&amp;lt;/label&amp;gt;
&amp;lt;input type=&amp;quot;text&amp;quot; class=&amp;quot;form-control&amp;quot; ng-model=&amp;quot;someone.name&amp;quot; id=&amp;quot;name&amp;quot; placeholder=&amp;quot;Enter name&amp;quot;&amp;gt;&amp;lt;/input&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;button class=&amp;quot;btn btn-default&amp;quot; ng-click=&amp;quot;cancel()&amp;quot;&amp;gt;Cancel&amp;lt;/button&amp;gt;
&amp;lt;button type=&amp;quot;submit&amp;quot; class=&amp;quot;btn btn-default&amp;quot;&amp;gt;Submit&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;JavaScript Code&lt;/p&gt;</description></item><item><title>AngularJs and VideoJs problem: Video only loaded on hard refresh, not on switching page</title><link>https://log.rowanto.com/posts/angularjs-and-videojs-problem-video-only-loaded-on-hard-refresh-but-not-on-switching-page/</link><pubDate>Sat, 08 Feb 2014 11:00:00 +0000</pubDate><guid>https://log.rowanto.com/posts/angularjs-and-videojs-problem-video-only-loaded-on-hard-refresh-but-not-on-switching-page/</guid><description>
&lt;p&gt;So I was working on a private project with angular js and video js, and I am loading videojs dynamically after I got the source of the video, and there&amp;rsquo;s this very interesting problem where videojs will only be loaded only if you hard-refresh the page (f5-button). If you navigate to the page where it contains the video, or if you were on the page, go somewhere else, then come back again, the video won&amp;rsquo;t be loaded anymore and you&amp;rsquo;ll only get your old html5 video from the browser.&lt;/p&gt;</description></item></channel></rss>