Home
Login
Download
Flatnux
Themes
Plugins
plugins Flatnux 2011
Documentation
Installazione
Database
create themes
Traduzioni
Angolar 2 example
AngularJs example
Features
Site Map
Language
Search
any word
all word
exact phrase
search
0 New notifications
Login
Password recovery
English
Italiano
English
Documentation
AngularJs example
Esempio applicazionee AngularJS in Flatnux:
Nome:
Cognome:
{{saluta()}}
Codice sorgente (sections/nomepagina/):
header.php:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
section.it.html oppure section.php:
<div ng-app="myApp"> <div ng-controller="userController"> <p>Nome: <input type="text" ng-model="utente.nome">>/p> <p>Cognome: <input type="text" ng-model="utente.cognome">>/p> <p ng-controller="greetingController">{{saluta()}}>/p> </div> </div> <script src="controller.js"></script>
controller.js:
angular.module("myApp", []) .controller("userController", function ($scope) { $scope.utente = {nome: "Mario", cognome: "Rossi"}; }) .controller("greetingController", function ($scope) { $scope.saluta = function () { return "Buongiorno " + $scope.utente.nome + " " + $scope.utente.cognome + "!" }; });