6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

angular.js + coffeescriptでError: [$parse:isecdom]が出たとき

Last updated at Posted at 2014-09-24

angular.jsでcoffeescriptを使用している場合は
最後にreturnを書いてあげる。

$scope.hoge = ->
  $('p').hide()
  return false

###理由 
コンパイル後のNG記述
returnでDOMノードの関数を返すようになっている
Error: [$parse:isecdom]というエラーが出る。

$scope.hoge = function() {
 return $('p').hide();
};

コンパイル後のOK記述

$scope.hoge = function() {
 $('p').hide()
 return false
};

参考URL
https://docs.angularjs.org/error/$parse/isecdom

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?