script.js ( File view )

  • By shri 2014-04-13
  • View(s):10
  • Download(s):0
  • Point(s): 1
			var app = angular.module("instantSearch", []);


app.filter('searchFor', function(){


	
	return function(arr, searchString){


		if(!searchString){

			return arr;
		
}

		var result = [];

		searchString = searchString.toLowerCase();

		// Using the forEach helper method to loop through the array
		angular.forEach(arr, function(item){


			if(item.title.toLowerCase().indexOf(searchString) !== -1){

				result.push(item);
			
}

		
});

		return result;
	
};


});


function InstantSearchController($scope){


	
	$scope.services = [
		{

			url: 'http://www.flipkart.com/search?q=ADHOC&as=off&as-show=on&otracker=start',
			title: 'ADHOC WIRELESS NETWORKS BY SIVA RAM MURTHY',
			price: 685,
			active:false,
			image: 'adhoc.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=DATA+BASE+COMPLETE&as=off&as-show=on&otracker=start',
			title: 'DATA BASE COMPLETE BOOK',
			price: 300,
			active:false,
			image: 'database.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=DATA+MINING&as=off&as-show=off&otracker=start',
			title: 'DATA MINING Concept and Techniques BY J.HAN M.KAMBER J.PEI',
			price: 485,
			active:false,
			image: 'data mining.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=data+communication+BEHROUZ&as=off&as-show=off&otracker=start',
			title: 'DATA COMMUNICATION BY BEHROUZ FOROUZAN',
			price: 535,
			active:false,
			image: 'dc.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=SYSTEM+SOFTWARE+BY+LELAND+L.BECK+D.MANJULA&as=off&as-show=off&otracker=start',
			title: 'SYSTEM SOFTWARE BY LELAND L.BECK D.MANJULA',
			price: 380,
			active:false,
			image: 'ss.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'UNIX SYSTEM PROGRAMMING BY Terrence Chan',
			price: 350,
			active:false,
			image: 'usp.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'TCP/IP Protocols suit 4th addition by Behrouz F',
			price: 420,
			active:false,
			image: 'tcp.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Descrete event system simulation by Jerry Banks',
			price: 380,
			active:false,
			image: 'dess.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Modern Approach to verbal and non verbal by R.S.Aggrawal',
			price: 410,
			active:false,
			image: 'MA.jpg'
		
},
		
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Quantitative Aptitude by Sultan Chand ans sons',
			price: 400,
			active:false,
			image: 'qa.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Multi Media fundamentals by Klara narstet',
			price: 500,
			active:false,
			image: 'fm.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Database management system by Ramkrishanan S',
			price: 550,
			active:false,
			image: 'db.jpg'
		
},
		
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'manufacturing system Engineering by Katsunohiomi',
			price: 440,
			active:false,
			image: 'manu.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Automobile Machines by N K Giri',
			price: 550,
			active:false,
			image: 'au.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Elements of fracture Mehanics by Prashant kumar',
			price: 560,
			active:false,
			image: 'em.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Wireless communication by T.S rapport Pearson Educations',
			price: 470,
			active:false,
			image: 'wc.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Introduction to radar system by Merrill I.Skolnik',
			price: 390,
			active:false,
			image: 'rad.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=UNIX+SYSTEM+PROGRAMMING+BY+Terrence+Chan&as=off&as-show=off&otracker=start',
			title: 'Introduction to Algorithms by Thomas H. Cormens',
			price: 280,
			active:false,
			image: 'al.jpg'
		
},
		{

			url: 'http://www.flipkart.com/search?q=WORLD+WIDE+WEB+BY+ROBERT+W.SEBESTA&as=off&as-show=off&otracker=start',
			title: 'WORLD WIDE WEB BY ROBERT W.SEBESTA',
			price: 450,
			active:false,
			image: 'www.jpg'
		
}
	];
$scope.toggleActive = function(s){

		s.active = !s.active;
	
};

	// Helper method for calculating the total price

	$scope.total = function(){


		var total = 0;

		// Use the angular forEach helper method to
		// loop through the services array:

		angular.forEach($scope.services, function(s){

			if (s.active){

				total+= s.price;
			
}
		
});

		return total;
	
};


}


			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
adhoc.jpg10.53 kB28-02-14 20:24
al.jpg8.29 kB28-02-14 20:33
au.jpg10.64 kB28-02-14 20:29
<data>0.00 B97% 28-02-14
database.jpg10.69 kB28-02-14 18:04
db.jpg9.26 kB28-02-14 20:25
dc.jpg6.80 kB28-02-14 18:02
dess.jpg10.18 kB28-02-14 20:13
emjpg.jpg7.75 kB28-02-14 20:31
fm.jpg12.45 kB28-02-14 20:35
index.html1.30 kB28-02-14 21:40
MA.jpg14.95 kB28-02-14 20:17
manu.jpg10.47 kB28-02-14 20:28
qa.jpg9.45 kB28-02-14 20:18
rad.jpg6.61 kB28-02-14 20:38
script.js5.21 kB28-02-14 21:59
ss.jpg6.26 kB28-02-14 18:02
style.css3.52 kB28-02-14 21:43
tcp.jpg11.61 kB28-02-14 20:11
usp.jpg10.06 kB28-02-14 18:03
wc.jpg9.27 kB28-02-14 20:32
www.jpg8.16 kB28-02-14 18:04
<Rno135>0.00 B0 0%
readme.pdf23.33 kB28-02-14 22:45
...
Sponsored links

script.js (205.66 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D