
What should I be testing and when should I be writing tests? A frontend development article by Andy Shora ← back to andyshora.com | Tweet this article Why do you need to write tests? Because you're not Chuck Norris. Chuck Norris' code tests itself, and it always passes, with 0ms execution time. Ok, seriously, writing tests feels good! I think it's essential that you learn to love the feeling of ha
AngularJS を本気でつかうための tips 最近、管理画面で AngularJS をつかってみている。 そんな中で、いくつか工夫した点があるのでそれをシェアさせていただきます。 XHR のエラーを表示する XHR のエラーがおきた際のハンドリングをいちいち手でかくのは非効率。管理画面とか中の人しかつかわないので、エラーがおこった旨を随時報告するだけでよい。 そんなケースでは以下のようにする。 angular.module('myapp.exceptionHandler', []) .config(['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push(function($q, $log, $rootScope) { return { 'responseError': function(
Stay Relevant and Grow Your Career in TechPremium ResultsPublish articles on SitePointDaily curated jobsLearning PathsDiscounts to dev toolsStart Free Trial7 Day Free Trial. Cancel Anytime. If you haven’t tried Angular yet, you’re missing out on why people say JavaScript is the most flexible language in the world. Angular is the only framework that doesn’t make MVC seem like putting lipstick on a
AngularJSでHTTP Requestする際に、1.1.1より前まではX-Requested-Withをつけてたらしいんだけど、CORSのpreflightを飛ばさないためにデフォルトでは削除したらしい。 https://github.com/angular/angular.js/issues/1004 X-Requested-Withをつけたい場合は以下のようにする。 myModule.config(function($httpProvider) { $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; }); このヘッダでXHRかどうか判断する場合がある(Railsとかも)ので注意。
Direct what? As I mentioned in last week’s article I have been working with Angular.js for personal projects lately. This was largely the result of me, approximately six or seven months ago, feeling like I was missing out on the new hotness by not knowing a client-side MV* framework. I looked around at a lot of options, including: Backbone.js (A crowd favorite, with rock-solid online support/docum
Having too many $watch can create performance issues for webpages, especially on mobile devices. This post will explain how to remove extraneous $watch and accelerate your application! Any $watch can be disabled when it is no longer needed. Thus, we have the freedom to choose when to remove a $watch from the $watch list. Let’s see an example: File: app.js app = angular.module('app', []); app.contr
何これ AngularJSで遊んでるメモ 経緯 研究室でJS勉強会が行われている.1週に1回(たまに無い週も)って形で4~5回行われた. 初め数回でChrome拡張作ろう → jQueryのAjax完璧 → プロトタイプ継承完璧!とかしながら,good partsみたいなものを適宜考えながらやっていった. やることがなくなったので何しよう → AngularJSとか流行ってるしやるか! 所感 まずAngularJS使う機会として3通りぐらいに分けれそう 1. クライアントサイドだけで完結するパターン 2. APIのみ提供するサーバを持ちつつクライアントサイドをほぼ静的に書くパターン 3. RailsなどのWAFと組み合わせて使うパターン AngularJSを触れて良い所として,以下のようなものが順に挙げられる Controllerを用いた明示的Scope document.getEleme
So you love the way single-page apps like Gmail and Trello feel, but aren’t sure where to start. Maybe your JavaScript code has become disorganized enough that you are convinced to try one of the numerous JavaScript MVC libraries/frameworks on your next project but aren’t sure which one to choose. I’m writing a book on single-page apps so I’ve pretty much “read the internet” on the topic. I’l
I would like to access my $scope variable in Chrome's JavaScript console. How do I do that? I can neither see $scope nor the name of my module myapp in the console as variables.
I am trying to "stopPropagation" to prevent a Twitter Bootstrap navbar dropdown from closing when an element (link) inside an li is clicked. Using this method seems to be the common solution. In Angular, seems like a directive is the place to do this? So I have: // do not close dropdown on click directives.directive('stopPropagation', function () { return { link:function (elm) { $(elm).click(funct
Neosavvy has a drive to pass on sound software design practices, user experience, and technical skills to our clients. We focus primarily on data driven appl...
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く