Tiny module implementing primitive Angular binding to thread.js library
https://github.com/h2non/angular-thread
var app = angular.module('app', ['ngThread'])
app.factory('CoolService', function ($thread) {
var users = [
{ name: 'barney', age: 36 },
{ name: 'fred', age: 40 },
{ name: 'pebbles', age: 12 }
]
var thread= $thread({
env: { search: 'fred' },
require:
'https://raw.githubusercontent.com/lodash/lodash/2.4.1/dist/lodash.min.js'
})
thread.run(function (users) {
return _.find(users, function (user) {
return user.name === env.search && user.age > 18
})
}, [ users ]).then(function (user) {
console.log(user) // -> { name: 'fred', age: 40 }
})
})
bower install angular-thread
component install h2non/angular-thread
I wish it could be useful
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.