Made by
const app = angular.module("app", []); class MyAppCtrl { } app.component("myApp", { template: `<greeting name="'World'"></greeting>`, controller: MyAppCtrl }); class GreetingCtrl { get upperName() { return this.name.toUpperCase(); } } app.component("greeting", { bindings: { name: "=" }, template: `<h1>Hello {{$ctrl.upperName}}!</h1>`, controller: GreetingCtrl }); angular.bootstrap(document.body, [
All slide content and descriptions are owned by their creators.
I have some html data that I'm loading in from a json file. I am displaying this html data by using ngSanitize in my app and using ng-bind-html. Now I would like to convert any links in the json blob from the standard <a href="some_link">link</a> to: <a ng-click="GotoLink('some_link','_system')">link</a>. So I'm doing some regExp on the json file to convert the links, but for some reason however n
こんにちは。もやし炒めをたべています、きたけーです。 DOM要素からAngularJSのスコープのオブジェクトを得る術を知ったのでメモ。デバッグするときに捗りそう。こんなかんじの内容をコンソールで叩きます。 var el = document.getElementById('hoge'); angular.element(el).scope(); Chromeのデベロッパーツールで選択している要素の場合 $0に選択している要素のDOMオブジェクトが入っているので angular.element($0).scope(); 親スコープを辿りたいとき angular.element($0).scope().$parent; 便利
I have the following state setup for a page using an abstract state and the controller as syntax: # Details page route .state 'title', url: '/title', abstract: true, template: '<ui-view/>', .state 'title.show', url: '/:titleId', templateUrl: 'title/show.html' controller: 'Title as t' For the purpose of this demo lets say I assign a variable to the 't' instance of the 'Title' controller and I do th
こんにちは。おなかが空きました。きたけーです。 AngularJSでLocalStorageを扱う術を知ったのでメモ。 ngStorage つかうモジュールはこれ gsklee/ngStorage · GitHub 。 LocalStorage と SessionStorageのインターフェイスを用意してくれる。 こんなかんじ var app = angular.module('App', ['ngStorage']); app.controller('SampleController', ['$scope', '$localStorage', function ($scope, $localStorage) { // 取り出し。デフォルトの値を設定できる。 $scope.$storage = $localStorage.$default({ title: '', description:
Help us understand the problem. What is going on with this article? こんにちは、@armorik83です。私のAngularJS歴は2年弱で、これまでAngularJSに関する記事はQiitaにたくさん書いてきました。例えば次のような記事です。 AngularJSアンチパターン集 2014.9 ここらでDirective Scopeの@=&をまとめておきたいと思う 2014.9 TypeScriptで書くAngularJSのMVC 2014.2 AngularJS Directiveの処理順を網羅してみた 2014.12 他にもニッチなものやイマイチだったものも含めてけっこうな数となってきました。また、こういった記事の縁で勉強会でも登壇させて頂きました。 モダンAngularJS 2014.12 GDG中国 TypeScr
(150522追記)最新のチュートリアルをまとめたAngularJSモダンプラクティスを掲載しました。この記事は2014年2月に掲載したとてもふるい記事です。最新記事をどうぞご覧ください。 この記事は記録のため残します。 AngularJSはチュートリアルに沿ってただ書くだけにするとすぐFat Controllerになる、とは他でも指摘されていますが、複数のコントローラを実装し始めた辺りから問題となってくるのが処理の重複です。すぐにでも一つのファイルにまとめて参照したいところです。 この記事(お前のAngular.jsはもうMVCではない。と言われないためのTutorial)やこの記事(AngularJSをTypeScriptで書くときのあれこれ)にはずいぶんと助けられましたが、ここで自分なりのTypeScriptでの書き方についてまとめておきます。 Factoryの例 クラスやメソッドの
これは AngularJS Advent Calendar 2015 の22日目(12/22)の投稿です。 このアドベントカレンダーの説明に次のようにあったので、 思い出というか、2015年の初め頃に AngularJS 1系で表題のものを作ったので、AngularJS でスマホサイト用の SPA を簡単に作れるよ!という例として紹介したいと思います。 過去記事はこちら。 モバイルWEB用の Qiita 新着投稿リーダーを作った [電車やカフェでの暇つぶしに] Qiita 新着投稿リーダーに検索機能をつけた Qiita リーダー AngularJS 1系と ionic で作っています。Qiita の投稿の取得には Qiita API v1 を利用しています。(v2 だとクロスオリジン制約にひっかかるので。現在ではもしかして解消されているかもしれない。) 静的リソース(JavaScript/
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く