Question

I want to create a reusable template, say contact information with

<input> name
<input> telephone
<input> email

now, I want to use this partial html in many instances. So I would populate the input for edit in one example or add new Contact in another. What's the best way to do this?

Was it helpful?

Solution

User angularjs directive. That's exactly what its designed to do. http://docs.angularjs.org/guide/directive

Here is a useful resource to get you started with directives: https://github.com/angular/angular.js/wiki/JsFiddle-Examples#version-110

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top