client/app/slides/slides_controller.js
author rougeronj
Mon, 23 Mar 2015 17:07:36 +0100
changeset 31 8d016c195d79
parent 26 c7dfe7185ef7
child 37 81ed4fbb1a64
permissions -rw-r--r--
get info of a slide and show it. Sanitize html from description field and add it to the scope
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
(function(){
31
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     2
	'use strict';
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
31
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     4
	angular.module('ammicoSlides',['ngResource', 'ngRoute'])
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     5
	.controller('slidesCtrl', function($scope, $routeParams, searchApi, $sce){
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     6
		
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     7
		$scope.slide = searchApi.slide.get({idSlide:$routeParams.idSlide, format:'json'}, function(data){
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     8
			data.details.description =  $sce.trustAsHtml(data.details.description);
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
     9
		});
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    10
		
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    11
		console.log($routeParams.idSlide);
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    12
		console.log($scope);
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    13
		//$scope.slide = booksModel.slides[$routeParams.idSlide];
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    14
	})
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    15
	.controller('slideEditCtrl', function(){
8d016c195d79 get info of a slide and show it. Sanitize html from description field and add it to the scope
rougeronj
parents: 26
diff changeset
    16
	});
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
})();