canjs / can-map-define

Define rich attribute behavior
https://canjs.com/doc/can-map-define.html
MIT License
3 stars 2 forks source link

Incorrect documentation #101

Closed Mattchewone closed 5 years ago

Mattchewone commented 5 years ago

Docs are showing this usage:

var CanMap = require("can-map");
require("can-map-define");

var Person = CanMap.extend({
    define: {
        fullName: function(){
            return this.attr("first") + " "+ this.attr("last")
        }
    }
})

Which should be:

var CanMap = require("can-map");
require("can-map-define");

var Person = CanMap.extend({
    define: {
        fullName: {
          get () {
              return this.attr("first") + " "+ this.attr("last");
          }
        }
    }
})