RatchetJS(モバイルフレームワークではなく、websocketサーバー、つまりgoratchet.com !!)とAngularJS(v1.5.8)でアプリを構築しようとしています。私の質問は、プロジェクトの構成、ルーティング、ページの読み込みに関連しています。統合AngularJS with Ratchet.js
ラチェットトランジションを角度jsルーティングとコントローラでうまく演奏するにはどうすればよいですか?ここに私がこれまで持っていたものがあります。
index.htmlを
<!DOCTYPE html>
<html lang="en" ng-app="Application">
<head>
<meta charset="utf-8">
<title>MyApplication</title>
<base href="/">
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Include the compiled Ratchet CSS -->
<link href="css/ratchet.css" rel="stylesheet">
<!-- <link href="css/ratchet-theme-ios.css" rel="stylesheet"> -->
<!-- <link href="css/ratchet-theme-android.css" rel="stylesheet"> -->
<!-- Include the compiled Ratchet JS -->
<script src="js/ratchet.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/angular-route.min.js"></script>
<script src="app/app.js"></script>
</head>
<body>
<div class="view" ng-view></div>
</body>
</html>
角度JSアプリファイル。
'use strict';
(function() {
var Application = angular.module('Application', ['ngRoute']);
Application.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
controller: 'DefaultController',
templateUrl: 'pages/home.html',
})
.when('/pages/chat.html', {
controller: 'ChatController',
templateUrl: '/pages/chat.html',
})
.otherwise({ redirectUrl: '/' })
;
$locationProvider.html5Mode(true);
}]);
Application.controller('DefaultController', ['$scope', '$route', function($scope, $route) {
$scope.title = "Grettings";
}]);
Application.controller('ChatController', ['$scope', function($scope) {
$scope.title = "Chat view";
}]);
})();
/pages/...
フォルダ(home.html
とchat.html
)2つのファイルがあります。 home.htmlは、のように見えるのリンクが含まれています。私はdata-ignore="push"
を使用している場合
<a data-ignore="push" href="/pages/chat.html">Go to chat</a>
は、ページがロードされるが、それなし角度(これなしラチェット遷移によって、当然のことながら、ページがラチェットによってロードされるが、どのように私は私のアーキテクチャ/ルーティングを処理する必要があります。私は、遷移のためのラチェットを使用したいの提供
... AngularJSはルートをキャッチしていないとコントローラが呼び出されることはありません?
http://goratchet.com/はCSS js/css UI/UXフレームワークです。WebSocket ..とは関係ありません。トランジションを提供します。 –