Em segunda-feira, 29 de dezembro de 2014 11h53min12s UTC-2, Mohan Radhakrishnan escreveu:
Hi,I would like to use Resig's method to use OO like this.var User = Class.extend({
init: function(firstName,lastName){
this.firstName = firstName;this.lastName = lastName;
},
getFirstName: function(){
return this.firstName;
},getLastName: function(){
return this.firstName;
}
});There are two questions.Q1 :How is the 'Class' framework code recognized by Angular ?Q2:When I code a jasmine test like thisdescribe("User's First Name", function() {
it("firstName", function() {
expect(new User("firstName","lastName").getFirstName()).toEqual("firstN ame");
});
});I get 'Uncaught ReferenceError: Class is not defined'So I think I haven't understood how to make angular recognize the 'Class' framework code. I am trying to build a domain model.
I did that but then later just included two lines because all the requirements are in mainConfig.js. I think if the application uses requirejs properly then the karma ordering problems are solved.
'vendor/requirejs/require.js',
'js/mainConfig.js',
댓글 없음:
댓글 쓰기