Geeks With Blogs
Zakaria's Blog
Command ObjectsGrails controllers support the concept of command objects. A command object is a class that is used in conjunction binding, usually to allow validation of data that may not fit into an existing domain class.Declaring Command ObjectsCommand object classes are defined just like any other class. @grails.validation.Validate... class LoginCommand ......

XML and JSON ResponsesUsing the render method to output XMLGrails supports a few different ways to produce XML and JSON responses. The first is the render method.The render method can be passed a block of code to do mark-up building in XML : def list() { def results = Book.list() render(contentType: "text/xml") { books { for (b in results) { book(title: ......

Redirects and ChainingRedirectsActions can be redirected using the redirect controller method : class OverviewController { def login() {} def find() { if (!session.user) redirect(action: 'login') return } … } } Internally the redirect method uses the HttpServletResponse object's sendRedirect method.The redirect method expects one of :Another closure ......

ControllersA controller handles requests and creates or prepares the response. A controller can generate the response directly or delegate to a view. To create a controller, simply create a class whose name ends with Controller in the grails-app/controllers directory (in a subdirectory if it's in a package).The default URL Mapping configuration ensures ......

Angular ExpressionsAngular expressions are JavaScript-like code snippets that are usually placed in bindings such as {{ expression }}.For example, these are valid expressions in Angular:1+2a+buser.nameitem... Expressions vs. JavaScript ExpressionsAngular expressions are like JavaScript expressions with the following differences:Context: ......

BootstrapThis page explains the Angular initialization process and how you can manually initialize Angular if necessary.Angular <script> TagThis example shows the recommended path for integrating Angular with what we call automatic initialization. <!doctype html> <html xmlns:ng="http://angularjs.... ng-app> <body> ... <script ......

The Dot :index.html <div ng-app=""> <input type="text" ng-model="data.message"> <h1>{{ data.message }}</h1> <div ng-controller="FirstCtrl"> <input type="text" ng-model="data.message"> <h1>{{ data.message }}</h1> </div> <div ng-controller="SecondCtrl"> <input type="text" ng-model="data.message"> ......

Understanding ControllersIn Angular, a Controller is a JavaScript constructor function that is used to augment the Angular Scope.When a Controller is attached to the DOM via the ng-controller directive, Angular will instantiate a new Controller object, using the specified Controller's constructor function. A new child scope will be available as an injectable ......

Data BindingData-binding in Angular apps is the automatic synchronization of data between the model and view components. The way that Angular implements data-binding lets you treat the model as the single-source-of-truth in your application. The view is a projection of the model at all times. When the model changes, the view reflects the change, and ......

Conceptual OverviewThis section briefly touches on all of the important parts of AngularJS using a simple example.ConceptDescriptionT... with additional markupDirectivesextend HTML with custom attributes and elementsModelthe data shown to the user in the view and with which the user interactsScopecontext where the model is stored so that controllers, ......

Copyright © A.K.M. Zakaria | Powered by: GeeksWithBlogs.net