pillowpillow / ng-annotations Goto Github PK
View Code? Open in Web Editor NEWangular wrapper based on annotations
angular wrapper based on annotations
There seems to be an argument where you can pass the module name, but documentation doesn't say anything about it.
The current version has a problem when i try to use the decorator @attach
I receive this error in Chrome:
My code is:
'use strict'
import {controller, inject, attach, autobind} from 'ng-annotations'
@controller('bTagsController')
@inject('$filter')
class BTagsController {
@attach('$filter')
$filter
constructor () {
this.items = []
this.$filter = $filter
this.selectedItems = []
}
get filteredItems() {
var filteredByText = this.$filter('filter')(this.items, this.searchText)
console.log(filteredByText)
return this.$filter('filter')(filteredByText, this.isNotAdded)
}
add (item) {
this.selectedItems.push(item)
this.searchText = ''
}
remove ($index) {
this.selectedItems.splice($index, 1)
}
@autobind
isNotAdded (item) {
return this.selectedItems.indexOf(item) === -1
}
}
export {BTagsController}
With the version 0.1.12
works well
It would be cool if this library gets converted to typescript
It's possible to upgrade this module to babel 6? I've forked the repo and updated babel-loader and babel-core to the 6 version but still got some troubles, all the annotations got broken and could not use ng-annotations in my project. @autoBind and @Inject annotations were not working as expected at least. I've uploaded in my fork the work done until now, the branch of my fork is called "babel-6-upload"
Wouldn't it be slightly more elegant to have a stateful attribute on the @filter
attribute instead of defining a property?
e.g.
@filter(name='...', stateful=true)
I'd raise a PR if you'd appreciate this change
Why not adding a @decorator annotation so we can override the angularjs services easily?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.