Home  >  Article  >  Web Front-end  >  Angular-command collection

Angular-command collection

巴扎黑
巴扎黑Original
2017-06-23 14:48:401821browse


2017-06-08

Angular directive.

ng-init: Initialization data

Use the = symbol in the attribute value. Variable values, user; separated, and cannot use var

# #ng-app: Enable angular application mode, a page can only appear once

It can have attribute values, but the project must be defined in js. If there is no attribute value, it can be used directly in the view

ng-model: Two-way data binding

##ng-bind: Another way to write interpolation, the interpolation symbol cannot be seen when the page is rendered

ng-repeat: Loop

ng-show: Whether to display

ng-show="true"

ng- hide: Whether to hide

Angular.module gets the

# of the application ##var arr = angular.module("mk",[])

The first parameter represents the app representation

The second parameter represents the dependency collection

Even if there is no Dependencies must also be written in empty arrays

controller defines the controller

arr.controller("kz",function($scope){})

The first parameter represents the name of the controller

The second parameter represents the factory method

There are no parameters by default

The scope is an empty object

The above is the detailed content of Angular-command collection. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn