码迷,mamicode.com
首页 > 其他好文 > 详细

service

时间:2015-11-02 15:37:26      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

Angular.js Services

app.service("foo", function() {
    var thisIsPrivate = "Private"
    this.variable = "This is public"
    this.getPrivate = function() {
        return thisIsPrivate
    }
})


app.factory("foo2", function() {
    return new Foobar()
})

function Foobar() {
    var thisIsPrivate = "Private"
    this.variable = "This is public"
    this.getPrivate = function() {
        return thisIsPrivate
    }
}

 

service

标签:

原文地址:http://www.cnblogs.com/jzm17173/p/4930037.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!