Angular??????????????UI???????
???????????? ???????[ 2016/6/21 15:17:50 ] ????????????????? ???????
???????????
????· nodejs
????· webstorm
???????????
????webstorm?д??????web???
????????html??js?????
??????????д???2??????з??????????????????html??js?????
??????????
????????????
????????е??????????angularjs?????????????????????bower??????????
????1) ???bower????????
??????webstorm??terminal????н??
????npm install bower -save
????2) ?????bower.json???
??????н??????bower.json????????????bower???????????á?
????bower init
????3) ???angular????
?????????????????angular???????????angular-mocks???
????bower install bootstrap -save
????bower install angular -save
????bower install angular-mocks -save
?????????????????
????????????????nodejs????????nodejs???????????????′???package.json?????
????1)???http-server???
????npm install http-server -save
????2)??????????
????jasmine-core:javascript??????????
????karma:???javascript???????????????е?????
????karma-chrome-launcher: ??chrome???????е?????
????karma-jasmine: jasmine-core??karma?е?????????
????karma-junit-reporter: ????junit???棻
????protractor:E2E??????
?????????????
????????node???????????package.json??????script???dependencies?ж?????????????script????start??????????????????test?????????????潲??
"name": "angularjs-test"??
"version": "0.0.1"??
"dependencies": {
"bower": "^1.7.7"??
"http-server": "^0.9.0"??
"jasmine-core": "^2.4.1"??
"karma": "^0.13.22"??
"karma-chrome-launcher": "^0.2.3"??
"karma-jasmine": "^0.3.8"??
"karma-junit-reporter": "^0.4.1"??
"protractor": "^3.2.1"
}??
"scripts": {
"postinstall": "bower install"??
"prestart": "npm install"??
"start": "http-server -a localhost -p 8000 -c-1"??
"pretest": "npm install"??
"test": "karma start karma.conf.js"??
"test-single-run": "karma start karma.conf.js --single-run"
}
???????ú???????????????????????????????http://localhost:8000
????npm start
??????????????
??????д???????
?????????js?????js???index.js????index.js?ж???congroller????????????add??????????:
/**
* Created by stephen on 2016/3/24.
*/
(function (angular) {
angular.module('app'?? []).
controller('indexCtrl'?? function ($scope) {
$scope.add = function (a?? b) {
if(a&&b)
return Number(a) + Number(b)
return 0;
}
});
})(window.angular);
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11