<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的更多相关文章

  1. Angular Service入门

    1.Angular内置service Angular为了方便开发者开发,本身提供了非常多的内置服务.可以通过https://docs.angularjs.org/api/ng/service查看Ang ...

  2. angular service provider

    关于  angular service factory  provider 方面有很多,我也来写一篇加深下印象 provider 是一切方法的基础,所以功能也最强,provider 用来定义一个可以被 ...

  3. [Angular 2] Directive intro and exportAs

    First, What is directive, what is the difference between component and directive. For my understandi ...

  4. 关于angular 自定义directive

    关于angular 自定义directive的小结 首先我们创建一个名为"expander"的自定义directive指令: angular.module("myApp& ...

  5. Angular service, 服务

      早上开车上班, 发现车快没油了, 于是拐进加油站. 有一辆出租车也在加油..   Angular service在一个应用里是以单例形式存在的. 这个单例的实例是由service factory( ...

  6. AngularJS学习之 ngTable 翻页 功能以及利用angular service准备测试数据

    1.官网链接  https://github.com/esvit/ng-table#4.0.0 2.安装ngTable后,一定要记得先注册到自己的项目 .module('pttengApp', [ ' ...

  7. [Angular] Custom directive Form validator

    Create a directive to check no special characters allowed: import {Directive, forwardRef} from '@ang ...

  8. [Angular] Test Directive

    directive: import { Directive, HostListener, HostBinding, ElementRef } from '@angular/core'; @Direct ...

  9. [Angular] Export directive functionalities by using 'exportAs'

    Directive ables to change component behaives and lookings. Directive can also export some APIs which ...

随机推荐

  1. [转]利用vertical-align:middle实现在整个页面居中

    本文转自:http://www.cnblogs.com/xueming/archive/2012/03/21/VerticalAlign.html 如果想让一个div或一张图片相对于整个页面居中,用v ...

  2. CF Error Correct System

    Error Correct System time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  3. 历经曲折的freescale

    从来没有想到自己在大学最信任的队友会突然放弃,,为了这个,,我可以说放弃了很多,,这几天可以我也不知道怎么办了,,我想不通的是为什么可以这样,为什么可以这么不负责任,,为什么这么自私,,这些我永远都不 ...

  4. Linux 命令 - su: 以其他用户和组 ID 的身份来运行 shell

    在 shell 会话状态下,使用 su 命令将允许你假定为另一个用户的身份,既可以以这个用户的 ID 来启动一个新的 shell 会话,也可以以这个用户的身份来发布一个命令. 命令格式 su [OPT ...

  5. Sql Server Profiler跟踪死锁

    Sql Server Profiler一个很重要的应用场景就是监视分析死锁. 下面通过一个例子来学习Profiler是如何监视死锁的. 1. 创建测试数据模拟死锁, 创建表Table_A和Table_ ...

  6. JavaScript之数组对象

    Array类型是ECMAScript中最常用的类型了. 一.声明方式 1.使用Array构造函数 var arr1 = new Array(); 如果预先知道要保存数组的数量, 也可以给构造函数传递该 ...

  7. 通过命令行连接oracle数据库/进入sql plus

    1.直接打开SQL Plus登录,需要用户名和密码 开始->程序->Oracle->应用程序开发->sqlplus 我的电脑是“开始”->“Oracle - OraDb1 ...

  8. blazeds使用remote访问

     欢迎交流转载,请注明出处:http://www.cnblogs.com/shizhongtao/p/3487128.html 1.配置及说明 jar包说明 从官方上下的Blazeds中,默认的配置有 ...

  9. 关于jQuery中.attr()和.prop()的问题

    话说写了几句代码在ie8上能正常运行,chrome和ff却不行,朋友说这就是RP啊,郁闷! 其实功能需求是这样的,两个radio:男和女,一个button:重置.启动页面默认选中男,在用户选择女之后又 ...

  10. flex&bison 1

    .   {ECHO;}-----单独的flex使用中有效 .   { yyerror();}--------flex和bison交叉使用,即使不调用yyerror函数,也会报错的 error: syn ...