AngularJS is one of the widely used frameworks for modern single-page web application development which is designed to support dynamic views in the applications. To further assist AngularJS developers, this research proposes how the concept of model-driven development can be applied to AngularJS-based development. We propose a UML profile for AngularJS for building a model of an AngularJS web application, and a set of transformations that transform the model into a code template. The developer can then fill in the template to make a complete workable web application. Also, a transformation tool is developed to assist in constructing the code template. Using a case study application, the evaluation in terms of transformation rate shows that the automatically generated code covers 87% of the complete code of the case study, which means it could greatly help reduce development time.