2 angular.service('conference', function($resource){
3 this.Work = $resource( '/data/conference/Work/:_id', { _id:'' } );
4 }, {$inject:['$resource'],$creation:'eager'});
11 authors:[ { name:'', surname:'', inst:'', email:'' } ],
14 this.$watch('$location.hashPath', this.hash_change);
17 WorkForm.prototype = {
18 hash_change: function() {
19 var id = this.$location.hashPath;
21 this.work = this.Work.get({ _id: id });
25 this.work = new this.Work( this.master );
28 var l = this.$location;
29 this.work.$save(function(work){
30 l.hashPath = work._id;
36 <div ng:controller="WorkForm">
38 <div ng:show="work._id">
39 <a href="#{{work._id}}">permalink to this work</a>
41 <label>Vrsta rada:</label><br/>
42 <input type="radio" name="work.type" value="simp"> Simpozij <br/>
43 <input type="radio" name="work.type" value="pred"> Predavanje <br/>
44 <input type="radio" name="work.type" value="poster"> Poster <br/>
45 <input type="radio" name="work.type" value="round"> Okrugli stol <br/>
47 <div ng:repeat="author in work.authors">
48 [<a href="" ng:click="work.authors.$remove(author)">X</a>]
49 <input name="author.name" ng:required>
50 <input name="author.surname" ng:required>
51 <input name="author.inst" >
52 <input name="author.email" ng:required>
54 [<a href="" ng:click="work.authors.$add()">Add another author</a>]
65 <tr ng:repeat="author in work.authors">
66 <td>[<a href="" ng:click="work.authors.$remove(author)">X</a>]</td>
67 <td><input name="author.name" ng:required></td>
68 <td><input name="author.surname" ng:required></td>
69 <td><input name="author.inst" ></td>
70 <td><input name="author.email" ng:required></td>
74 <td>[<a href="" ng:click="work.authors.$add()">Add another author</a>]</td>
86 Naslov: <input name="work.title" size="60"><br/>
89 <textarea name="work.abstract" cols="50" rows="5"></textarea> <br/>
90 <input type="submit" value="Save" ng:click="save();" disabled="{{$invalidWidgets}}">
91 <input type="reset" value="Reset" ng:click="reset()">
92 <a href="Work">Novi rad</a>
96 {{$window.location.href}}
97 <pre>work = {{work}}</pre>
98 <pre>master = {{master}}</pre>
102 work.$id={{work.$id}}
103 work._id={{work._id}}