用angularjs 模块时Error: [ng:areq] Argument 'controller' is not a function,

今天学习angular时,发生了这个错误,网上大多数是说,不能直接用function写controller了,要用module,但我就是用的module啊代码如下:
js :

var mainApp = angular.module("mainApp",[]);

mainApp.controller("controller",function($scope){
	$scope.student={
		firstName:"hepenghui",	
		fees:400,
		fullName: function(){
		return "hello bitch";	
		}
	};
});
html :



    
        
        
    
    
        Your name: 
        
Hello {{yourname || 'World'}}!
1+2={{1+2}}
dianjicishu : {{count}}

{{ student.fullName() }}

解决办法:既然用模块了,就不行了,改成  bingo!!

你可能感兴趣的:(用angularjs 模块时Error: [ng:areq] Argument 'controller' is not a function,)