LoginSignup
18
21

More than 5 years have passed since last update.

AngularJs+CakePHPコメントシステム

Posted at

AngularComment

AngularJs + CakePHP

練習用に作ったコメントシステムです。

今回気にした主な点は以下の3つ。
* AngularJSでのきちんとしたディレクトリ構造
* CakePHPのAPIComponentの自作
* git Flowの使用

こんな感じの画面
WS000008.JPG
ソースコードはこちら
GitHub

フロント側はこちらのサイトを参考にさせていただきました。
大変助かりました。

導入手順

API設定(CakePHP)

  1. /api/以下のCakePHPのいつもの設定(DBの設定・tmp書き込み等)
  2. Migrationを全て起動
php cake.php Migration.migration run all

Front側の設定(AngularJS)

APIのアクセスURLに定数を設定しているので環境に合わせて設定してください

/js/services/constantService.js
angular.module('constantService', []).factory('Constant', function(){
    return {
        BaseUrl : '/comment/'
    }
});

※localhost/comment/という場合の設定例

使用外部ライブラリ

  • Angular Loading Bar
    Ajax通信の時に画面上部にアニメーションを表示
  • ngStorage
    AngularJs上から簡単にSessionやloaclStorageにアクセスする
  • Notify.js
    右上に出るメッセージ
18
21
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
18
21