1

I'm an angular js newbie, so this might sound trivial. I'm trying to insert html form templates via a angularjs directive.Its like a user selects a particular form template and that template is then inserted into the page. Being new to angularjs i have no idea how to achieve this. Any pointers to implement this would be appreciated.

1 Answer 1

1

Read the AngularJS Directive Documentation - specifically, you'll be interested in the template and templateUrl parameters.

You can write out your template as a string, like template: '<div>foo</div>', or pass in the path to the file containing your html, like templateUrl: 'partials/mytemplate.html'.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok thnks for dat.But can u show me some example code to insert some html into a view on click of a button by writing a directive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.