angular service/directive
<html class=" js cssanimations csstransitions" ng-app="phonecatApp" >
<head>
<title>{{title}}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="/scripts/service/css/font.css" rel="stylesheet" type="text/css">
<link href="/scripts/service/css/style.css" rel="stylesheet" type="text/css" media="all">
<link rel="stylesheet" type="text/css" href="/scripts/service/css/magnific-popup.css"> </head>
<body ng-controller="controller1">
<div class="cart">
<a class="popup-with-zoom-anim" href ng-click="callNotify('message');">NOTIFY</a>
</div>
<!--<div my-Directive></div>
{{title}}-->
<script type="text/javascript" src="/Scripts/angular.min.js"></script>
<script type="text/javascript">
var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('controller1', ['$scope', 'notify', function ($scope,notify) {
$scope.title = "Compare";
$scope.click1 = function () { alert('abc'); };
$scope.callNotify = function (msg) {
notify(msg);
};
$scope.phones = [
{
'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.'
},
{
'name': 'Motorola XOOM™ with Wi-Fi',
'snippet': 'The Next, Next Generation tablet.'
},
{
'name': 'MOTOROLA XOOM™',
'snippet': 'The Next, Next Generation tablet.'
}
];
}]); phonecatApp.directive('myDirective', function () {
return {
template: 'Name: {{phones[0].name}}'
};
}); phonecatApp.factory('notify', ['$window', function (win) {
return function (msg) {
console.log('function in service ' + msg);
return false;
};
}]);
</script>
angular service/directive的更多相关文章
- Angular Service入门
1.Angular内置service Angular为了方便开发者开发,本身提供了非常多的内置服务.可以通过https://docs.angularjs.org/api/ng/service查看Ang ...
- angular service provider
关于 angular service factory provider 方面有很多,我也来写一篇加深下印象 provider 是一切方法的基础,所以功能也最强,provider 用来定义一个可以被 ...
- [Angular 2] Directive intro and exportAs
First, What is directive, what is the difference between component and directive. For my understandi ...
- 关于angular 自定义directive
关于angular 自定义directive的小结 首先我们创建一个名为"expander"的自定义directive指令: angular.module("myApp& ...
- Angular service, 服务
早上开车上班, 发现车快没油了, 于是拐进加油站. 有一辆出租车也在加油.. Angular service在一个应用里是以单例形式存在的. 这个单例的实例是由service factory( ...
- AngularJS学习之 ngTable 翻页 功能以及利用angular service准备测试数据
1.官网链接 https://github.com/esvit/ng-table#4.0.0 2.安装ngTable后,一定要记得先注册到自己的项目 .module('pttengApp', [ ' ...
- [Angular] Custom directive Form validator
Create a directive to check no special characters allowed: import {Directive, forwardRef} from '@ang ...
- [Angular] Test Directive
directive: import { Directive, HostListener, HostBinding, ElementRef } from '@angular/core'; @Direct ...
- [Angular] Export directive functionalities by using 'exportAs'
Directive ables to change component behaives and lookings. Directive can also export some APIs which ...
随机推荐
- PLS-00201: 必须声明标识符 'UTL_FILE'
解决办法: 用sysdba身份 把UTL_FILE包的执行权限给这个用户. 举例: 1.C:\Users\Anakin>sqlplus /nolog2.SQL> connect /as s ...
- U-boot新手入门
U-boot新手入门 一.编译U-boot 二.U-boot命令详解 1.帮助命令 # help autoscr -run script from memory base -print or set ...
- 转载js实现打印功能
<div id="print">打印的内容</div><a href="javascript:void(0)" onclick=& ...
- Unity3D除了在编辑器里,怎么用代码给一个Texture类型的变量赋值
resource.load上来一张贴图就行. using UnityEngine; using System.Collections; public class example : MonoBehav ...
- dotnetbar 的BalloonTip的用法
‘设置提示标题 tip.SetBalloonCaption(txt_ID, "提示") ’设置显示的控件 和显示内容文本 tip.SetBalloonText(txt_ID, &q ...
- 第五十三篇、OC利用AFN上传视频到服务器
整体思路已经清楚,拿到视频资源,先转为mp4,写进沙盒,然后上传,上传成功后删除沙盒中的文件. 本地拍摄的视频,上传到服务器: //视频转换为MP4 //转码操作... _hud.mode = MBP ...
- GitHub 基本操作流程
GitHub是最先进的分布式版本控制工具,下面是我学习中总结的操作流程,仅供参考 ----------------------------------------------------------- ...
- 引用、return
C语言中没有引用,引用(reference)是c++对c语言的重要扩充.通俗点说,引用就是“起别名”.比如变量data,和它的引用 RefData.虽然名字不同,但是操作他们的时候,都操作的是相同的内 ...
- Geographic Coordinate Systems
Coordinate Systems Geographic Coordinate Systems This is an archive of a previous version of the Arc ...
- undefined local variable or method ‘xxx’ for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xbc88d6c>错误解决方案
官方文档如下: https://github.com/rspec/rspec-rails/blob/master/Capybara.md Capybara 2.0 To use Capybara 2. ...