Let's start with a basic plasmid.
{{code.usageinter1}}
AngularPlasmid directives support the ng-repeat
directive provided by AngularJS. Using this, you can
make the task of creating markers vastly easier.
Let's add 10 markers to the current plasmid, at locations 50, 90, 130, 200, 350, 400, 450, 600, 735, and 900. We'll assume that they are all 10 nucleotides in length for now.
{{code.usageinter2}}
The ng-repeat
declares and iterates n
over the given array values. The start
and end
attributes can use the iterated value by enclosing the value in double-braces {{
...}}
. This tells AngularJS to interpolate
the values for the start
and end
attributes.
Since ng-repeat
repeats the entire code block, you can also declare additional elements to be repeated. For instance,
to include labels for each of the markers, simply add a markerlabel
element within each marker:
{{code.usageinter3}}
Now, you'll get 10 labels positioned relative to each of the 10 markers that contain them.
To make this a complete example, let's add a tracklabel
and some trackscale
elements to provide the finished output.
{{code.usageinter4}}