哪位大神指点指点,拜谢!!!
angular.module('app', []) .constant('VERSION', '2.0') .config(function (VERSION) { }) .run(function ($rootScope) { $rootScope.version = 2.0; });
angular.module('app', []) .constant('VERSION', '2.0') .run(function ($rootScope) { $rootScope.version = 2.0; $rootScope.$on('version:change', function (e, newVersion) { $rootScope.version = newVersion; }); });
一般会把一些易变的数据挂载到$rootScope上,常量直接使用constant注册就好了,建议采用全大写下划线分割的方式命名常量
谢谢大神的指导👍🏻 From Noder
mark
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
一般会把一些易变的数据挂载到$rootScope上,常量直接使用constant注册就好了,建议采用全大写下划线分割的方式命名常量
谢谢大神的指导👍🏻 From Noder
mark