Documentation
¶
Index ¶
- func MakeFuncInjectable(f interface{}) (jsFunc js.S, err error)
- func RegisterResource(resourceType reflect.Type, angularName string, ...)
- func Service(name string) *js.Object
- type Deferred
- type Directive
- type Element
- type Event
- type Inject
- type Location
- type LocationProvider
- type LocationSearch
- type Module
- type Q
- type RootScope
- type Route
- type RouteConfig
- type RouteParams
- type RouteProvider
- type Scope
- func (s *Scope) Apply(f func())
- func (s *Scope) Broadcast(event string, args ...interface{})
- func (s *Scope) CopyScope() *js.Object
- func (s *Scope) Emit(event string, args ...interface{})
- func (s *Scope) EvalAsync(f func())
- func (s *Scope) Listen(event string, listener interface{})
- func (s *Scope) On(event string, listener interface{}) (unregisterFunc func())
- func (s *Scope) Watch(key string, f func(newValue interface{}, oldValue interface{}))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeFuncInjectable ¶
MakeFuncInjectable returns a func that transforms *js.Object's to the corresponding go types.
Types ¶
type Deferred ¶
Deferred is angulars defer object returned from $q.defer()
type Directive ¶
type Directive struct { Restrict string Link func(scope *Scope, el *Element, attrs map[string]interface{}) TemplateURL string Scope []string }
Directive is the go variant of an angular directive At least a templateURL should be given.
type Element ¶
Element is a basic jqLite angular element
type Event ¶
Event is an angular event from $emit/$broadcast
func (*Event) CurrentScope ¶
CurrentScope see $event.currentScope
func (*Event) DefaultPrevented ¶
DefaultPrevented see $event.defaultPrevented
func (*Event) PreventDefault ¶
func (e *Event) PreventDefault()
PreventDefault see $event.preventDefault()
type Inject ¶
type Inject struct {
// contains filtered or unexported fields
}
Inject represents a resource that can be injected into an controller/directive/route-resolve func
func GetFuncInjectables ¶
GetFuncInjectables reads the function arguments and transforms them to *Inject resources. If an arguments is not found the returns an error.
func GetResource ¶
GetResource returns the resource for a given reflect.Type
type Location ¶
Location implements $location
func (*Location) CurrentPath ¶
func (*Location) Search ¶
func (l *Location) Search() LocationSearch
type LocationProvider ¶
func (*LocationProvider) Html5Mode ¶
func (l *LocationProvider) Html5Mode(on bool)
type LocationSearch ¶
func (LocationSearch) Get ¶
func (l LocationSearch) Get(key string) string
func (LocationSearch) Has ¶
func (l LocationSearch) Has(key string) bool
type Module ¶
Module is an angular module
func (*Module) NewController ¶
NewController creates a new controller on the given module The arguments of the controller should only contain resources that have been added with a call to RegisterResouce
func (*Module) NewDirective ¶
NewDirective registers a directive. The fomat should be: func(.... resources) Directive
type RouteConfig ¶
type RouteConfig struct { TemplateURL string Template string Controller string Resolve map[string]interface{} }
RouteConfig is an implementation of the config used to $routeProvider.when
type RouteParams ¶
RouteParams is a copy of $routeParams
func (RouteParams) Get ¶
func (r RouteParams) Get(key string) string
Get returns the value at the given key
type RouteProvider ¶
RouteProvider implements $routeProvider
func (*RouteProvider) Otherwise ¶
func (r *RouteProvider) Otherwise(config RouteConfig)
Otherwise is used as a 404
func (*RouteProvider) When ¶
func (r *RouteProvider) When(url string, config RouteConfig)
When is used to register a new URL
type Scope ¶
Scope is the angular $scope
func (*Scope) Apply ¶
func (s *Scope) Apply(f func())
Apply is the angular $scope.$apply and should be called when changing values trough goroutines or event listeners
func (*Scope) CopyScope ¶
CopyScope is used to provide a *js.Object scope for structs inside a controller