Skip to content

Releases: davej/angular-classy

v1.2.4

22 Aug 10:10
Compare
Choose a tag to compare

Now works with npm (thanks @mattlewis92).

npm install angular-classy

Usage:

const angular = require('angular');
const classy = require('angular-classy');

const app = angular.module('app', [classy]);

v1.2.3

07 Mar 14:15
Compare
Choose a tag to compare

Now you can programmatically get the classy version.

var app = angular.module('app', ['classy']);
console.log(app.classy.version); // -> '1.2.3'

V1.2.1

26 Feb 20:21
Compare
Choose a tag to compare

Added Source Map for angular-classy.min.js file.

v1.2.0

26 Feb 19:50
Compare
Choose a tag to compare

Added support for bindWatchToClass option

When you use the controllerAs syntax this allows you to set up a watcher that will bind to the class rather than the scope. This means you don't need to hardcode the controller name to your watch key.

Keywords ({object}, {collection} etc..) and expressions also work just like they did before.

// before 1.2
app.classy.controller({
  __options: {
    addToScope: false
  },
  watch: {
    'todoCtrl.location.path()': function(newVal) { },
    '{object}todoCtrl.todos': function(newVal) { },
  }
});

// 1.2
app.classy.controller({
  __options: {
    addToScope: false,
    bindWatchToClass: true
  },
  watch: {
    'location.path()': function(newVal) { },
    '{object}todos': function(newVal) { },
  }
});

Remember you can also set options on a per-module basis (instead of per-controller). For example, to set options on the app module:

app.classy.options.controller = {
  addToScope: false,
  bindWatchToClass: true
};

For more info and discussion see issue #49.

v1.1.0

07 Mar 01:13
Compare
Choose a tag to compare

No new features in this release but I've refactored the code.

  • Classy is now written in Javascript instead of CoffeeScript. I still love CoffeeScript and will continue to use it for private projects but it's easier for people to contribute in Javascript so I decided to switch.
  • I've done some benchmarking and performance optimisations. Classy 1.1 is over 2x faster than Classy 1.0.

FYI: The performance optimisations are not related to the switch from CoffeeScript to JS, it is a completely independent refactoring.

v1.0.0

02 Mar 09:17
Compare
Choose a tag to compare

Whoop!

Main features here: http://davej.github.io/angular-classy/1.0.html

Look through the pre 1.0 beta releases for a more comprehensive changelog: https://github.com/davej/angular-classy/releases

v1.0.0-rc.2

28 Feb 14:23
Compare
Choose a tag to compare
v1.0.0-rc.2 Pre-release
Pre-release

You can now do shorthand option declarations. A shorthand option declaration will be applied to all plugins. You can use shorthand options at both the controller or module level.

So, instead of:

__options: {
  'bindData': {
    addToScope: false
  },
  'bindMethods': {
    addToScope: false
  }
}

You can now write:

__options: {
  addToScope: false
}

or:

app.classy.options.controller = {
  addToScope: false
};

v1.0.0-rc.1

03 Feb 16:02
Compare
Choose a tag to compare
v1.0.0-rc.1 Pre-release
Pre-release

You can now define methods using angular expressions. Whenever the method is called it will evaluate the expression and return the expression's result. Often, an expression will be much more concise and readable than a full method definition.

Example usage:

  methods: {
    _getIncompleteTodos: 'todos | filter:{ completed: false }',
  }

v1.0.0-beta.8

15 Jan 15:27
Compare
Choose a tag to compare
v1.0.0-beta.8 Pre-release
Pre-release

Accept addToClass option to not add data/methods properties to Class (this). Fixes #39

Example Usage:

myApp.classy.options.controller = {
    bindData: {
        addToClass: false
    }
}

v1.0.0-beta.7

23 Oct 19:45
Compare
Choose a tag to compare
v1.0.0-beta.7 Pre-release
Pre-release
  • bindMethods happens in the init cycle instead of initBefore
  • Add explicit Coffeescript return statements to avoid side-effects (and slightly reduce filesize)