{% assign lvl = page.url | append:'X' | split:'/' | size %} {% capture relative %}{% for i in (3..lvl) %}../{% endfor %}{% endcapture %}
{% raw %}<fa-app ng-controller="TouchStartCtrl">
<!-- The fa-view receives the touchstart event from the fa-surface, and calls $scope.touchStart, bound to fa-touchstart on the fa-view. -->
<fa-view fa-touchstart="touchStart($event)" fa-pipe-from="myEvents">
<fa-modifier fa-size="[200, 100]">
<fa-surface fa-pipe-to="myEvents"
fa-background-color="'orange'">
Touch start count: {{touchStartCount}}
</fa-surface>
</fa-modifier>
</fa-view>
</fa-app>
<script>
angular.module('faTouchStartExampleApp', ['famous.angular'])
.controller('TouchStartCtrl', ['$scope', '$famous', function($scope, $famous) {
var EventHandler = $famous['famous/core/EventHandler'];
$scope.myEvents = new EventHandler();
$scope.touchStartCount = 0;
$scope.touchStart = function($event) {
console.log($event);
$scope.touchStartCount++;
};
}]);
</script>{% endraw %}
{% raw %}fa-app {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}{% endraw %}
{% raw %}fa-app {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}{% endraw %}